Commit Graph
293 Commits
Author SHA1 Message Date
Ryder Sun ef405bb721 fix: finish native collaboration turns on explicit completion
Use an invocation-bound assistant signal to return completed contributions to the scheduler without waiting for repeated native closing replies. Ignore late output, preserve settled native sessions, and retain independent version-bound group approvals.

Verified frontend 376 tests, desktop 1698 tests, both frontend builds and desktop pack. Real Claude, Hermes, Pi, OpenCode, Kimi and MiMo discussion completed after 9 rounds with all six approving candidate b91dddfe and matching immutable file hashes.
2026-10-30 15:59:51 +08:00
Ryder Sun 525901dd9a fix: preserve native tools and allow running conversation rename
Allow running conversations to rename and inspect locked settings. Honor writable group authorization across native discussion and concurrent replies, preserve configured plugins, and invalidate approvals when candidate files change.

Verify frontend 376 tests, desktop 1692 tests, web/desktop builds, and desktop pack. Electron confirms live rename and locked settings; native networking works, but repeated-output completion remains unresolved in OpenCode/MiMo.
2026-10-30 15:32:42 +08:00
Ryder Sun c6b08f4ce1 test: wait for observed tool start before cancelling native CLI
Replace child readiness-file timing with the actual mapped tool_start event so cancellation consistently verifies the matching stopped event. Ensure the fixture process is aborted during cleanup.

Checks: full desktop discovery suite 1685/1685 at concurrency 4; frontend 375/375; web and desktop builds; desktop pack; Electron first-run/returning-user loading, theme colors and narrow-window checks.
2026-10-30 11:09:34 +08:00
Ryder Sun d2f6171ddd fix: show one compact theme-aware discovery loader
Remove the duplicate progress bar and pulsing status dot. Reduce wave geometry to 190 by 72 and inherit existing light/dark accent colors. Record the provider-agnostic native CLI boundary in AGENTS.md.

Checks: frontend 375 tests; web and desktop builds; desktop pack; Electron first-run and returning-user checks with animated loader, light/dark colors and a 560px window.
2026-10-30 11:01:49 +08:00
Ryder Sun 05ec2bfbf0 merge: retain main updates without automatic Agent hard limits
Integrate origin/main while replacing tool-budget termination with a sequential OpenCode regression that verifies twenty native tools can finish normally. Preserve localized diagnostics for historical failures.

Checks: invocation watchdog and sequential OpenCode focused tests passed; frontend loading suite 375 tests passed before integration.
2026-10-30 10:54:32 +08:00
Ryder Sun 59a546e071 fix: require native Agent consensus and show discovery loading first
Preserve native CLI completion and recovery, collect explicit approvals for an immutable candidate, and honor invitation order. Display the existing loading animation before first-run onboarding. Keep provider configuration owned by native Agents.

Checks: desktop 1684 tests, frontend 375 tests, both frontend builds and desktop pack; real six-Agent Electron consensus completed, including a 381-second Hermes invocation.
2026-10-30 10:53:15 +08:00
Ryder Sun 9ed1552cec fix: bound stalled Auto discussion agent turns
Stop Auto V4 proposal and discussion invocations after prolonged answer silence, excessive tool calls, or an absolute turn deadline. Preserve streamed output when OpenCode or another native Agent never returns a terminal result.

Checks: watchdog and sequential OpenCode focused tests passed; frontend 370 tests and both builds passed; isolated Electron pack and code signature verification passed. Full desktop suite was attempted but blocked by unrelated concurrent test load and timeout failures.
2026-10-28 17:52:39 +08:00
Ryder Sun 4f10fd14d9 site: simplify landing messaging and refresh collaboration stepper
- Drop the 'V4' suffix from Auto Discussion branding across copy and structured data
- Remove the Capabilities section; fold its boundary/shared-context messaging into existing sections
- Rework the scenario stepper with round-by-round agent activity states (Waiting/Thinking/Working/Done) and bilingual runtime labels
- Bump asset cache versions; update landing tests (13 pass via node --test)
2026-10-28 13:43:40 +08:00
Ryder Sun d11deef490 release: prepare 1.0.8 with verified native CLI fixes and explicit limits
Align app, README and website downloads on 1.0.8. Document the separate Magpie
finish-reason defect and native configuration failures instead of treating CLI
detection as successful execution. Keep Apache-2.0 commercial-use terms
consistent and retain the ad-hoc signing/notarization disclosure.

Validation: desktop 1655 tests, frontend 370 tests, website 12 tests and packaging
8 tests; web/desktop builds; DMG/ZIP integrity and packaged signatures/licenses.
Electron five-Agent unlimited acceptance completed 19 native calls without
failed attempts or retries. Auto mode survives sending, completion and group
navigation. Native acceptance used an isolated Magpie hotfix; existing user
gateways were not replaced or restarted.
Meldwork-V1.0.8
2026-10-27 23:01:40 +08:00
Ryder Sun bd395b7a2f fix: finish native Agent queries and preserve discussion state
Keep Kimi read-only queries in manual approval mode rather than forcing a
planning cycle, and prefer its terminal rejection over feedback-free revision.
Preserve MiMo's same-message tail after the terminal RPC, forward supported
native configuration variables, cancel repetitive native output while retaining
partial content, and preserve each group's selected composer mode.

Validation: frontend 370 tests; desktop 1655 tests; web and desktop builds;
desktop pack and packaged signature verification. Audited all 13 installed
CLIs. A real five-Agent unlimited discussion completed 14 native calls through
an isolated Magpie null-tool-call fix. Five CLIs still have native configuration
failures; production Magpie remains unchanged. Electron UI acceptance awaits
macOS unlock; this commit does not certify production acceptance or publish a
release.
2026-10-27 21:09:46 +08:00
Ryder Sun 4c522c0997 release: unify 1.0.7 downloads and Apache-2.0 commercial-use terms
Update bilingual documentation and website, include the official Zcode logo and deployable license notices, and replace the unverified display font with the bundled OFL font. Guard version, download and licensing consistency in CI. Give the native ACP multi-phase integration test a realistic completion budget.

Validation: frontend 369/369, landing 12/12, deterministic eval 6 cases/18 results, web/desktop builds, pack/dist, DMG/ZIP integrity and extracted-app signature/license checks passed. Packaged Electron startup passed. The ACP restart group passed 10/10 after one full-suite timing failure; the full desktop suite is rerunning before publication.
Meldwork-V1.0.7
2026-10-27 15:28:09 +08:00
Ryder Sun 9971659e8a Merge remote-tracking branch 'origin/main' into 1.0.7
# Conflicts:
#	README.md
#	README.zh-CN.md
#	meldwork-landing/index.html
2026-10-27 15:17:12 +08:00
Ryder Sun 83709a13e8 fix: preserve interrupted discussion output and support native Zcode and Hermes formats
Prevent terminal-only plan dialogs from blocking headless Agents, preserve buffered replies on stop, and keep Chinese slash-separated text intact. Add Zcode discovery, execution, credentials diagnostics, and its official logo; use Hermes native streaming when supported.

Validation: 1637 desktop tests and 369 frontend tests passed; 91 follow-up CLI tests, web/desktop builds, packaging, Electron cancellation/reload checks, and live WorkBuddy invocation passed. ZGCI finish_reason and missing Zcode default credentials remain external limitations.
2026-10-27 15:14:40 +08:00
Ryder Sun 5a938f60d2 feat(landing): refresh landing page with ember background and bilingual i18n
- Add glyph-embers.js canvas background and i18n.js language switching
- Refresh index.html, main.js, and styles.css layout and content
- Bundle Fusion Pixel fonts for CJK display type
- Add landing test suite (node --test meldwork-landing/test/landing.test.cjs)
- Update landing docs and switch README license notice to Apache 2.0

Checks: node --test meldwork-landing/test/landing.test.cjs (11 passed)
2026-10-21 12:46:35 +08:00
Ryder Sun a97fd91975 feat: use 0-100 scoring for delivery preferences and refresh settings layout
- Replace three-step work preference dials with 0-100 score scale
  (desktop schema, prompts, frontend form, presets, styles, locales)
- Restructure general settings panel layout with WorkPreferences section
- Update landing page copy and README download details
- Update related frontend and desktop tests

Checks: npm --prefix frontend test (369 passed),
node --test desktop/test/workspace/work-preferences.test.cjs (3 passed)
2026-10-21 10:39:54 +08:00
Ryder Sun fbc6e08e80 chore: untrack local docs folder from version control
docs/ is already in .gitignore but two files remained tracked.
Removed them from the index so future docs stay local-only.
2026-10-21 10:39:50 +08:00
Ryder Sun 0591472bc4 docs: refresh V1.0.6 downloads and release details
Commit the previously retained documentation changes separately from V1.0.7
runtime work. Update English/Chinese README and landing download links, release
metadata and verification notes to the published V1.0.6 Apple silicon preview,
including the Ryder-Sun repository and website URLs.

Keep the existing product copy and document preview signing and acceptance limits.
Checks: reviewed the three-file diff and git diff --cached --check passed.
This is documentation only; no additional runtime tests were needed.
2026-10-20 14:32:58 +08:00
Ryder Sun 35b8075b87 perf: compact shared discussion context without acknowledging excerpts as full
Bound shared transcripts to 16000 characters with fair per-peer budgets. Retain
source IDs, opening/closing context, constraints, evidence and unresolved issues
using deterministic source excerpts; deduplicate repeated sentences and retain
early user anchors in frozen history. Partial text never proves full delivery.

Document native Agent findings, common-context guarantees and limitations.
The fixed 32-peer repetition sample drops 338018 to 6512 characters (98.07%);
this is not a universal compression rate or a lossless semantic guarantee.

Checks on the combined working tree: desktop full suite 1629/1630, with the sole
failure being an obsolete requirement for prompts longer than 24000 characters.
After replacing that assertion with compaction and fidelity checks, the complete
V4 natural-discussion file passed 40/40. Focused context/preferences/MiMo/preload
passed 47/47; frontend 365/365, builds, pack and Electron smoke passed.
git diff --cached --check passed.
2026-10-20 14:32:58 +08:00
Ryder Sun c92b30c2c6 feat: add optional delivery preferences to onboarding and settings
Let users start from a preset and tune delivery detail, initiative, evidence,
preferred collaborators and a short custom note. Make first-run setup skippable
and editable later; refresh collaborator choices after startup detection.

Validate and persist preferences through narrow local IPC with rollback and
active-run protection. Defaults add no prompt, custom notes are bounded, and
preferences never grant write access or add group participants automatically.

Checks on the combined working tree: frontend 365/365; focused context,
preferences, MiMo and preload 47/47; web/desktop builds and pack passed.
Isolated Electron verified presets, custom save, persistence, narrow-window
layout and Escape dismissal. git diff --cached --check passed.
2026-10-20 14:32:35 +08:00
Ryder Sun 67d4084de6 fix: isolate WorkBuddy CLI credentials and native model compatibility
Distinguish the bundled lite CLI's protected desktop login from independent
CLI installs. Do not infer authentication from unrelated provider keys or choose
the first local model. Offer explicit native tool-model selection as a collapsed
advanced option, pass its model through resume, and keep provider auth failures
run-scoped. Renderer APIs expose only model names and IDs; native secrets stay
in the main-process invocation environment.

Desktop-account/current-model reuse remains unresolved. The official assistant
API requires registered application credentials, OAuth and cloud forwarding;
this change does not bypass authentication or claim that integration is complete.

Checks on the combined working tree: readiness/WorkBuddy/catalog 71/71 and
frontend 365/365 passed; builds, pack and isolated Electron checks passed.
Earlier explicit-provider live direct/resume/group checks passed; these do not
prove automatic desktop-account reuse. git diff --cached --check passed.
2026-10-20 14:32:14 +08:00
Ryder Sun 7f9e95d86c fix: honor MiMo native provider configuration when checking readiness
Recognize the selected custom Provider instead of treating official-account
whoami output as proof that a configured native model cannot run. Keep native
model and credential selection inside MiMo and isolate auth probes in tests.

Checks on the combined working tree: focused context/preferences/MiMo/preload
47/47 passed; readiness/WorkBuddy/catalog 71/71 passed. Real MiMo ACP first call,
native Session continuation, and production Electron group invocation passed
without forcing a model. git diff --cached --check passed.
2026-10-20 14:31:41 +08:00
Ryder Sun f77fd8b0c0 fix: remove chat delivery controls and reclaim conversation space
Remove Tasks & delivery from direct and group conversations, including composer
binding and the obsolete UI smoke. Retain stored delivery records and backend APIs.
Hide the sidebar scrollbar while preserving scrolling, and remove the reported
conversation and execution-detail borders without redesigning the workbench.

Checks on the combined working tree: frontend 365/365; web and desktop builds,
desktop pack, and isolated Electron UI/native MiMo smoke passed. The smoke checked
three-row chat layout, no delivery panel, and a scrollable sidebar with no scrollbar.
git diff --cached --check passed.
2026-10-20 14:31:01 +08:00
Ryder Sun 6983e58791 fix: restore local Agent discovery startup animations
What changed
- Restore PixelBlast and WavePhysicsLoader with the three dependency.
- Show the discovery overlay and block workspace interaction while local Agent
  CLI detection runs; release the overlay on both success and failure.
- Restore theme styles and Chinese/English startup copy, with App coverage for
  pending detection, completion, errors and animation wiring.

Why
Restore the intended local Agent discovery startup experience while retaining
the existing workbench once detection settles. Keep this separate from P0 delivery.

Checks
- Final vitest run of DeliveryPanel.spec.js and App.spec.js: 54/54 passed.
- Previously completed combined-tree validation: frontend 362/362, web build,
  desktop build, desktop pack and Electron smoke passed. Pack lacks a Developer
  ID signing identity; deterministic delivery smoke does not test live providers.
- git diff --check and git diff --cached --check passed.

README.md, README.zh-CN.md and meldwork-landing/index.html remain uncommitted.
2026-10-19 22:28:22 +08:00
Ryder Sun c01f96b4c7 feat: add V1.0.7 P0 task delivery and human acceptance
What changed
- Document P0 scope, interactions, task/run/delivery states and acceptance criteria.
- Add optional task cards to existing conversations and bind execution through
  the existing composer; freeze inputs and retain independent delivery versions.
- Support version-specific revision, human review/acceptance, native Markdown
  and file exports, and reuse in a fresh read-only conversation.
- Persist delivery state and retained attachments through validated main-process
  IPC and narrow preload APIs; add component, workspace and Electron smoke tests.

Why
Turn conversations into reviewable work deliveries without replacing the existing
chat, Agent selection or permission flow. Run completion never implies acceptance.

Checks
- Final node --test desktop/test/workspace/delivery-tasks.test.cjs: 9/9 passed.
- Final frontend vitest DeliveryPanel.spec.js and App.spec.js: 54/54 passed
  on the combined working tree (startup restoration is committed separately).
- Earlier combined-tree frontend test: 362/362; web and desktop builds, desktop
  pack and deterministic Electron delivery smoke passed.
- Desktop full suite: 1607/1609. Both failures were 10-second V4 restart waits;
  each passed two isolated reruns. Unmodified main 7deb8a3 also passes in similar
  time (Gate 8.9s, ACP 5.9s), supporting load-sensitive timeout flakiness rather
  than an observed delivery regression. Full suite is not claimed all-green.
- git diff --check and git diff --cached --check passed.

Frontend three dependency and startup animation changes are intentionally left
for the next commit. Existing README and landing-page edits remain uncommitted.
2026-10-19 22:28:04 +08:00
Ryder Sun a501718400 docs: update README and website release information for V1.0.6
Point downloads to the published 0.1.6 Apple silicon asset, use the renamed repository, and describe the release improvements and verification limits. Checked README versions, website metadata, release links, local assets, and git diff --check.
2026-10-19 14:18:39 +08:00
Ryder Sun 7deb8a3d12 Merge feature/1.0.6 into main: Meldwork V1.0.6, and the V1.0.5 line that never reached main
What this brings into main (53 commits)
- The V1.0.5 line, published as a prerelease on 2026-09-17 (tag Meldwork-V1.0.5
  at bb55fad). It was released from feature/1.0.5 and never merged: local Agent
  readiness and recovery, isolated per-conversation Agent sessions, workspace
  preference and titlebar changes, the Pi capability probe, and the General
  Agent workspace positioning.
- Meldwork V1.0.6, the 38 commits after that tag plus the release-prep commit:
  - Agent reliability: tiered authentication failures with transient retries,
    long-lived ACP Agents that survive stops, restarts and hangs, a watchdog that
    no longer kills Agents that are still working, unsafe ACP permission requests
    refused in read-only turns, and WorkBuddy's bundled CLI launching again.
  - Group conversations: replies shown in dispatch order, natural multi-round
    discussions that no longer end on one slip, attachments and knowledge bases
    delivered to group Agents, a group no longer blocked by one unready member,
    and conversations that no longer wait for each other.
  - Interface: startup no longer blocked by Agent detection, marks for
    conversations waiting on a decision, a General settings tab with
    System/Light/Dark appearance, notes explaining why an installed Agent is
    unavailable, and a shared type scale and status colors. The chat page and the
    dialogs keep their previous look.
  - Internal: the 6000-line auto-runner split into modules grouped by purpose.
- Package version 0.1.6 and the CHANGELOG entry.
- docs/ is no longer tracked. That was done by 6aef211 on the V1.0.5 line; the
  files stay in history.

Why
main stopped at eac015d while the V1.0.5 release line, and then V1.0.6, moved
on. This joins them so main is the source for the next release. The V1.0.6 work
had been developed under the name feature/1.0.5; it lives on feature/1.0.6 now
and feature/1.0.5 is back at the published V1.0.5.

Checks
- main had no commit the branch lacked, so there are no conflicts and the merged
  tree is identical to feature/1.0.6 at 11a25df.
- On the code of ce995cb: npm --prefix frontend test 357/357, npm --prefix
  desktop test 1603/1603, deterministic evaluation 6 cases / 18 results, and the
  frontend build and build:desktop passed.
- The release build is verified again on this merge commit before it is tagged.
2026-10-17 19:14:26 +08:00
Ryder Sun 11a25df584 release: prepare Meldwork V1.0.6
What changed
- Package version 0.1.5 -> 0.1.6 in desktop and frontend (package.json and the
  lock files).
- CHANGELOG entry for 0.1.6 (Meldwork-V1.0.6 prerelease).

Why
V1.0.5 was published on 2026-09-17 from the tag Meldwork-V1.0.5 (bb55fad).
Everything after it, 38 commits of Agent reliability, group conversation and
interface work, is version 1.0.6. This line was developed under the name
feature/1.0.5 by mistake. It is feature/1.0.6 now, and feature/1.0.5 is back at
the published V1.0.5.

Checks
- Only version fields and the changelog change, and no test pins the version.
- The code under test is that of ce995cb: frontend 357/357, desktop 1603/1603,
  deterministic evaluation 6 cases / 18 results.
Meldwork-V1.0.6
2026-10-17 19:09:45 +08:00
Ryder Sun ce995cb93d feat: refresh the app UI and surface what needs the user
The chat page (header, messages, composer, run status and the animated empty
state) and the modal dialogs are deliberately left as they were before this
refresh: those files are byte-identical to 17c57f5.

What changed
- Design tokens: an 8-step type scale (readable text no smaller than 12px
  outside badges), semantic success/warning/danger/info colors for both themes,
  AA-contrast muted and accent text, a focus-ring token, elevation, layer and
  motion tokens, and a dark backdrop that is darker than the workspace card.
- Startup is no longer blocked by Agent detection. The full-screen WebGL overlay
  and the physics loader are removed (three is dropped from the dependencies);
  the sidebar, home page and composer show "Detecting local Agents" instead, and
  an empty Agent list is not reported as a setup problem while detection runs.
- Needs your decision: conversations waiting on a permission or decision are
  marked in the sidebar (rows, Agent icons, collapsed switcher) and listed on the
  home page. Group runs that finish while you are elsewhere get the same finished
  mark direct chats already had. Collapsed sidebar sections show a count.
- Settings: a new General tab (language, appearance: System/Light/Dark). The
  theme now follows the OS until one is chosen; it used to freeze on first
  launch. Agent cards explain why an installed Agent is unavailable (installed
  version, verified range, failed check) with a Re-detect action. Cloud
  connections ask before deleting.
- Gemini: a detected Gemini CLI gets its own logo. It stays out of the built-in
  list so nobody sees a "Not installed" card for an Agent Meldwork cannot install.
- Toasts: the duration grows with the message length and pauses on hover; errors
  use the alert role.
- Onboarding: a Skip button and arrow-key navigation.
- Unsent text is kept per conversation while the app is open.
- Copy: engineering terms (circuit breaker, hard budget, delivery owner) are
  gone from user-facing status text.
- Status colors, focus ring and the run-details waiting state use the new tokens.

Why
Small text and low-contrast grey carried the most important state (Agent
availability, time, hints); the brand color meant ready, done, running and
warning at once; and the app could not be used until local Agent detection
finished although history is local. This makes states legible and separable and
shows the ones that need the user.

Checks
- npm --prefix frontend test: 43 files, 357 tests passed
- npm --prefix frontend run build and build:desktop: passed
- Not verified in a running Electron window; the changed screens need a visual
  check in light and dark, Chinese and English.
2026-10-16 23:25:46 +08:00
Ryder Sun ef9933d571 fix: launch the WorkBuddy app's bundled CLI, which now ships only the lite bundle
What changed
- WorkBuddy is launched with CODEBUDDY_FORCE_LITE_WB_BUNDLE=1 when the install
  carries only dist/codebuddy-lite-wb.mjs, both for the capability probe
  (--help) and for real runs (the child environment). Installs that carry a
  regular bundle launch exactly as before, and other Agents are unaffected.
- Tests cover the lite-only layout, an install with a regular bundle, another
  Agent kind, an unreadable layout, a symlinked launcher, and the run
  environment.

Why
WorkBuddy 5.8.x updated its bundled CLI (2.161.0) to the lite bundle, which its
launcher loads only when that variable is set. Without it every headless call,
--help included, exits with MODULE_NOT_FOUND ("Cannot find module
'../dist/codebuddy'"). The capability probe therefore failed, WorkBuddy was
marked incompatible, and it disappeared from the usable Agent lists (new group,
@ menu). A CLI version outside the verified range does not block an Agent on its
own; only a failed capability probe does.

Checks
- npm --prefix desktop test: 1603 passed, 0 failed
- detectAgents() on this machine now reports WorkBuddy 2.161.0 as compatible; it
  was incompatible with a failed workbuddy-print probe before
2026-10-16 23:24:37 +08:00
Ryder Sun 17c57f57f8 test: a conversation stuck on an Agent must not stop another from using it
End-to-end version of the blocking fix, on the real LocalWorkspace: one direct
chat's turn never finishes, and a second direct chat with the same Agent has to
answer anyway while the first is still marked running. On the commit before the
fix this test times out, which is the symptom that was reported (the second
conversation sat on 'waiting for another Agent that is writing in the same
folder' until the first finished).
2026-10-16 16:10:03 +08:00
Ryder Sun 5054553a16 fix: the agent avatars no longer draw over the composer's @ menu
In a group chat the strip of member avatars above the composer (the run
status for the latest topic) was painted on top of the @ menu, covering its
'Agents' heading and the first rows.

The avatars overlap each other and order themselves with z-index 100, 99, 98
and so on. Nothing around them created a stacking context, so those numbers
competed with the page directly and beat the menu (z-index 4). The strip is
now its own stacking context, so the ordering only applies between the
avatars. The composer box gets the same treatment for the member chips (z-index
1-6): they were only contained while the box was focused, because the box's
focus transform happened to create a context.

Checked in a real renderer (headless Electron, the built frontend with a stub
bridge, a six-member group with a finished run and with a running run, composer
focused and not): the points of the menu covered by something else go from 36
to 0 in both states. jsdom has no layout, so composerStacking.spec.js pins the
CSS that keeps the numbers contained; two of its three cases fail without the
fix.

Checked with: npm --prefix frontend test (336 pass), build:desktop.
2026-10-16 16:02:48 +08:00
Ryder Sun e1500a73ef fix: conversations no longer wait for each other, even in the same folder
Sending to an Agent while the same Agent (or any Agent) was busy in another
conversation made the new conversation sit on 'Running' until the first one
finished. The cause was the writer lease, which was keyed by the real folder:
every writable conversation that used the same folder (and most keep the
default one) took turns, one at a time, across groups and direct chats.

9198bf6 had deliberately scoped the lease of direct chats to the chat so that
one writable chat could not block another Agent. 17cbd32 reverted that as a
regression and added a 'waiting for another Agent writing in the same folder'
notice. That was the wrong call: it made the product behave like a single
queue. This commit reverts 17cbd32 and goes one step further than 9198bf6:

- the writer lease is scoped to the conversation for groups as well as direct
  chats, so conversations never wait for each other; writers inside one
  conversation still take turns
- the waiting notice, the waitingForWorkspaceKinds snapshot field and the
  scheduler queue callbacks that only existed for the folder lock are removed
  with the revert
- the old rule 'group chats serialize writes across symlink aliases' is
  replaced by its opposite; new tests cover the same Agent in two direct chats
  and a group at once, group chats sharing a folder through a symlink alias,
  and that turns of one conversation share a lease scope while another
  conversation in the same folder does not
- architecture.md states the new rule and the trade-off

Trade-off: two Agents in different conversations can now edit the same files
at the same time, like two terminals in one directory. Output capture compares
.meldwork-output/ before and after a run, so when two conversations produce
deliverables in the same folder at the same time one may attach a file the
other wrote. No guard was added for that.

The new write-scheduling tests fail on the previous commit (two fail, one
never gets its second Agent started).

Checked with: local-workspace-write-scheduling (6 pass), run-scheduler,
run-coordinator, state, harness, npm --prefix frontend test (333 pass).
2026-10-16 15:10:35 +08:00
Ryder Sun 4a0915594f test: pin that unsupported ACP client requests get an error, never a success
fs/* and terminal/* requests from an Agent that never was offered those
capabilities, and unknown methods, must each receive an error response. The
behaviour held partly through parameter validation; the test now states the
contract (no result field, numeric error code, unknown methods get -32601).
2026-10-16 11:55:16 +08:00
Ryder Sun 5641969445 fix: switching between read-only and write no longer restarts the ACP process
The ACP runtime was identified by a signature that included the session mode
(plan/build for MiMo and OpenCode, default/accept_edits for Hermes). Group
discussions alternate between a read-only proposal and a write-enabled turn, so
the signature changed, the process was closed and the stored native session was
reported invalid, losing the conversation's context on every switch.

The mode is applied on every turn with session/set_mode, so it does not
identify a process. What genuinely needs another process (Hermes' and
OpenCode's permission policy is passed through the environment) is already part
of the signature through the environment, so those still start separately.
MiMo, whose arguments and environment are identical in both modes, now keeps
one process and one session across a read-only turn, a write turn and another
read-only turn.

The new test fails on the previous commit with LOCAL_AGENT_SESSION_INVALID.

Checked with: cli-native-acp-lifecycle (16 pass).
2026-10-16 11:51:00 +08:00
Ryder Sun 4b8ddd917f docs: describe the module layout and reliability rules, and fix dead links
architecture.md pointed at docs/flows.md, permissions.md, variables.md and
automation.md, which exist on no branch, and at three more that exist only on
main (this branch keeps /docs/ untracked). The related-documents list now
links only files tracked in the repository.

Adds a Code Map (what each invocation, prompt and auto-runner module owns and
where new behaviour should go) and the Reliability Rules the harness now
enforces, so the next change starts from the layout instead of the 6000-line
class.
2026-10-16 11:43:34 +08:00
Ryder Sun 0e4f1620e6 refactor: split the 6000-line auto-runner into files grouped by what they do
LocalWorkspaceAutoRunner was one class of 6000 lines. Its 99 largest methods now
live in eleven files named for their topic (recovery, collaboration,
natural-discussion, v4-context, v4-delivery, v4-synthesis, v4-results,
v4-phase, v4-discussion, task-graph, rounds) and are assembled onto the same
prototype the way the existing natural-decisions and v4-outcomes parts already
were. local-workspace-auto-runner.cjs keeps the constructor, start/resume and
run-level helpers (285 lines); the largest remaining file is 965 lines.

This is a move, not a rewrite. The split was generated by a script that copies
method source verbatim, and checked three ways before the tests ran:
- all 135 prototype methods exist with the same name and an identical source
  hash before and after (only the class constructor text differs, because the
  mixins are listed after it)
- a scope analysis finds no identifier that is read but not declared or
  imported in any of the 15 auto-runner files
- node --check on every file

The V2 round and V3 task-graph runs, which only exist to resume older runs,
are in their own files so they can be deleted together when that support ends.

Checked with: npm --prefix desktop run test:workspace (627 pass).
2026-10-16 11:43:34 +08:00
Ryder Sun 958d18152b fix: MiMo/OpenCode turns with tool calls are no longer cut short, and a CLI's own error is no longer masked by EPIPE
Two ways a CLI run ended early or with the wrong reason:

- MiMo and OpenCode print a step_finish after every model step. A step that
  ends with reason tool-calls is followed by more steps, but the transport
  terminated the process 250 ms after the first step_finish, so every turn
  that used tools came back as a partial answer. Only a final step now ends
  the run.
- Codex reads its prompt from stdin. A CLI that exits at once (expired
  sign-in, rejected flag) while a prompt larger than the pipe buffer is still
  being written produces EPIPE, which was reported as LOCAL_AGENT_SEND_FAILED
  instead of the CLI's own message. A closed pipe now waits for the process to
  finish and reports its stderr (so a sign-in failure is recognised as one);
  a process that stays alive without reading is still a send failure after
  5 seconds.

Both regressions fail on the previous commit.

Checked with: cli-adapters (74 pass incl. cli-process-support).
2026-10-16 11:29:28 +08:00
Ryder Sun bf49afcd92 feat: a member that is not ready no longer blocks messages to the whole group
Sending to everyone in a group failed with 'this local Agent is unavailable'
as soon as one member was not ready, so one broken CLI made the whole group
unusable. When the recipients are implicit (everyone, or auto discussion),
members that are not ready are now left out and the user is told which ones
were skipped. Agents the user picked or @mentioned explicitly are kept so the
send can still report them, and when nobody is ready the full list is kept so
the problem is not hidden.

Checked with: composerContext spec (3 new cases), npm --prefix frontend test
(333 pass).
2026-10-16 11:21:36 +08:00
Ryder Sun 49ed8aee0f fix: an Agent stays available through an inconclusive probe, and keeps its shell environment
Two ways a healthy Agent used to drop out of use without anything being wrong
with it:

- readiness: OpenClaw's 7 second status check, or any probe that crashes,
  marked the Agent unavailable at once, so it vanished from the picker until
  the next successful probe. A timeout is not a 'not signed in' answer. An
  Agent that was available now stays available through inconclusive results
  for up to 10 minutes; a definitive answer (signed out, incompatible version,
  a recorded auth failure) still applies immediately, and an Agent that was
  never available is not made available by it.
- login shell: when the shell used to capture PATH and API keys did not answer
  (slow rc file, cold boot), the bare app environment was used and cached for
  30 seconds, so Agents started without the user's PATH or keys and failed
  with sign-in errors. The last environment the shell produced is kept and
  reused; the timeout is 10 seconds; with no earlier success the failure is
  cached for 5 seconds instead of 30, measured from when the capture ends.

Both new tests fail on the previous commit.

Checked with: local-workspace-agent-catalog (22 pass), local-agent-readiness
(39), cli-network-environment, main-security (51).
2026-10-16 11:21:36 +08:00
Ryder Sun 462c1bd783 fix: an ACP turn no longer dies on traffic this client does not know
The ACP transport failed the whole turn on anything it did not recognise: a
banner line on stdout, a notification with an unknown method, a session update
kind added by a newer Agent, or an unknown request. Every Agent upgrade that
adds a message therefore broke Meldwork until it was updated, and a single
large tool result (over 1 MiB on one line) failed the turn.

- stdout lines that are not JSON objects are ignored
- unknown notifications and session updates that fail validation are dropped
  before they reach the SDK, which logs rejected messages with their params
- unknown requests are forwarded with their params stripped, so the Agent gets
  a proper 'method not found' answer instead of waiting, and nothing
  secret-bearing is logged
- the per-line limit is 4 MiB (still bounded; total input and reply limits are
  unchanged)
- truncated JSON that starts like a message, an invalid response payload and
  invalid permission requests still fail closed

The Kimi 'unsafe protocol input' test described the old behaviour; it now
checks that malformed JSON still fails closed and that unknown traffic carrying
a secret neither fails the turn nor reaches a log. The new tolerance test
fails on the previous commit (LOCAL_AGENT_PROCESS_FAILED).

Checked with: cli-adapters-agent-protocols (69 pass), cli-native-acp-lifecycle
(15), cli-acp-tolerance, cli-adapters (64).
2026-10-16 11:21:36 +08:00
Ryder Sun a97afa9b5b feat: deliver attachments and knowledge bases to group Agents; one prompt module per mode
Group chats with several Agents run on the V4 path, which never forwarded the
user's attached files to the Agents (the send was validated against what each
Agent can read, then the files were dropped), and its prompts omitted the
knowledge-base hints, the answer language and the deliverable folder contract.

- attachments are now staged for manual group replies and for every turn of
  an automatic discussion; frozen prompts only gain the staged-file section
- manual group replies no longer use the phased 'proposal' template (asking
  for capabilities, work items and a receipt). prompts/manual-reply-prompt
  tells each Agent that everyone answers on their own, whether it may change
  files, and to answer in the user's language
- natural discussion prompts move to prompts/natural-discussion-prompt with
  named sections (brief, writer, owner, routing, receipt), now including the
  group name and topic, knowledge bases, the answer language and, for the
  writer, the .meldwork-output contract
- shared language and delivery contracts live in prompts/prompt-contracts

Also made the hanging-ACP-initialize test independent of spawn counting: under
load the 300 ms timeout killed the first process before it recorded itself, so
the next spawn counted as the first one and hung (16 of 32 stressed runs).

Checked with: new tests for each prompt module and for attachment delivery
(both fail on the previous commit); the V4, context-pack and delivery test
files pass.
2026-10-16 10:49:44 +08:00
Ryder Sun 3ce566f152 refactor: split the invocation's session, outputs, budget, prompt and failure handling into modules
The 1500-line invokeLeased still mixed session bookkeeping, workspace output
capture, budget accounting, prompt assembly and failure classification with
the run lifecycle. Each is now a small module with unit tests:

- InvocationSession: one place that resumes, adopts, discards (rebuilds) and
  completes the native session; the three copies of the 'start a fresh
  session' dance, one of them dead code, are gone
- InvocationOutputs: workspace baseline, media import and outcome descriptors
- invocation-budget: usage recording; a payload without a recorded wire size
  no longer fails the turn
- invocation-prompt: the prompt one Agent receives (frozen, direct, group)
- invocation-failure: why an invocation ended (stopped, timed out,
  interrupted, cancelled, failed) and the hidden error metadata
- permission helpers for resumed decisions moved next to the permission policy

invokeLeased is about 1000 lines shorter and reads as the run lifecycle.
Behaviour is unchanged; focused invocation tests and the new module tests
pass.
2026-10-16 10:21:25 +08:00
Ryder Sun 68145eb319 refactor: extract receipt parsing, watchdog, stream marker filter and permission policy from the invocation
local-workspace-agent-invocation.cjs held four independent pieces of logic
inside one 1500-line method. They now live in small modules with their own
tests, and the invocation only wires them together:

- collaboration/collaboration-receipt.cjs: parse and normalise the receipt
  (unchanged behaviour; the existing receipt tests now import it directly)
- runs/invocation-watchdog.cjs: startup, inactivity and stall windows
- collaboration/answer-marker-filter.cjs: hides control markers while the
  answer streams
- agents/agent-permission-policy.cjs: automatic answers to permission
  requests, read-only turns only approve side-effect-free tools

Two latent defects fixed on the way:
- the watchdog cleared its timer on the first event without re-arming it, so
  an Agent that went silent right after its first event was never stopped
- the marker filter upper-cased the buffer to find markers, which shifts the
  cut position for characters whose upper-case form is longer (e.g. ss)

Checked with: node --test on the new module tests; npm --prefix desktop run
test:workspace (595 pass).
2026-10-16 10:09:38 +08:00
Ryder Sun c3c090f83b fix: write state compactly and durably, and record main-process faults
- The workspace state is rewritten synchronously on the main process for
  every save. It is now compact JSON written through the private atomic
  writer, which fsyncs before renaming (the old path could leave a
  truncated file after a crash). The Run Ledger snapshot is compact too.
- Unhandled rejections and uncaught exceptions in the main process are
  written to a size-capped, secret-redacted meldwork-diagnostics.log in
  userData instead of disappearing, and a renderer that crashes is
  reloaded instead of leaving a blank window.

Checks: run-ledger, local-workspace-state, local-workspace and
main-security tests (185 pass). Full desktop suite: 1540 pass; frontend
web and desktop builds pass (existing large-chunk warning only).
2026-10-15 19:38:33 +08:00
Ryder Sun 26d4be2404 fix: compare installed Agent CLI versions as releases
The installer decided "up to date" and "already installed" with a
substring test, so 11.2.3 counted as 1.2.3 and a newer CLI was offered a
downgrade. It now extracts both versions and compares them as releases
(installed is current when it is the recipe's version or newer), falling
back to the old string match only when a version cannot be parsed.

Checks: agent-installer and the installer facade API test (37 pass,
including a new version comparison test). Full desktop suite: 1540 pass.
2026-10-15 19:38:33 +08:00
Ryder Sun 00ba2d3b38 fix: import only files an Agent wrote, including paths with spaces
28127b3 imports files whose absolute paths appear in a reply, to catch
outputs written outside .meldwork-output. Those candidates skipped the
baseline and start-time checks, so a file the Agent merely mentioned
(the README it read, the user's staged attachment) was imported as an
output, and paths with spaces were cut at the first space.

Reported paths are now imported only when their content changed during
this run and they are outside the .meldwork-input staging folder.
Backticked, quoted and Markdown-linked paths keep their spaces.

Checks: agent-output-importer (11 pass, including a new reported-path
test). Full desktop suite: 1540 pass.
2026-10-15 19:38:33 +08:00
Ryder Sun 17cbd32387 fix: keep one writer per folder and show when an Agent waits for it
9198bf6 gave every direct chat its own scheduler key so that one writable
chat would not block another. That broke the one-writer-per-folder rule:
two Agents could edit the same files at once, and a direct chat and a
group could write the same folder concurrently. The underlying problem
was that a writer waiting for the folder lease showed nothing and looked
like a dead Agent (no queued event, no watchdog, no output).

- Scheduler requests report onQueued/onGranted when they actually wait.
- Direct chats use the real-folder key again; while an Agent waits for
  the folder, the run lists it in waitingForWorkspaceKinds and the run
  status card says it is waiting for another Agent writing in the same
  folder (zh/en). A stopped wait clears the mark.

Checks: run-scheduler (new queue notice test), write-scheduling (the
concurrent-direct-chat test now asserts the second writer waits, is shown
as waiting, then runs), run-coordinator public run keys. Full desktop
suite: 1537 of 1538 before adding the new public key to that list, which
now passes; npm --prefix frontend test (330).
2026-10-15 19:17:03 +08:00
Ryder Sun 8d8f9e65f6 fix: let discussion peers see workspace file paths instead of [path]
Peer transcripts in natural discussions replaced every token that starts
with "/" by [path]. Agents working on the same repository could not tell
each other which file they changed, and API routes such as /api/users or
commands such as /login were erased too.

Natural discussion transcripts now show files inside the shared
workspace as workspace-relative paths, keep non-filesystem tokens, and
still redact other absolute local paths (/Users, /tmp, ...) and secrets.
Phased-V4 delivery text keeps the previous redaction because its hashes
take part in resume checks.

Checks: collaboration-records (new peer path test), natural discussion
(new end-to-end relative path test), natural transcript and delivery
suites. Full desktop suite: 1537 pass.
2026-10-15 19:04:42 +08:00
Ryder Sun b2249f0859 fix: stop skipping every WorkBuddy permission check in write mode
28127b3 added --dangerously-skip-permissions next to acceptEdits when a
conversation allows workspace writes. That flag lets the CLI run any
command and write anywhere on the machine without confirmation, which
goes beyond Meldwork's opt-in workspace-write boundary and differs from
every other Agent. Write mode now relies on acceptEdits, which accepts
file edits in the working directory.

The local machine has no CodeBuddy CLI, so an edit-only tool allowlist
was not added; an unverified flag could break every WorkBuddy turn.

Checks: new cli-adapters test for WorkBuddy write/read-only arguments;
WorkBuddy adapter and protocol tests (7 pass). Full desktop suite: 1537.
2026-10-15 19:04:42 +08:00
Ryder Sun 6e0becfb70 fix: refuse unsafe ACP permission requests during read-only turns
Local invocations answer ACP permission prompts automatically. The
handler picked the "allow" option for every request, ignoring whether the
turn was read-only, so a read-only discussion participant (for example
Hermes running with command approval prompts) had edit, delete, move,
command execution and mode-switch requests approved.

Read-only turns now approve only side-effect-free tool kinds (read,
search, fetch, think) and refuse everything else, including requests
without a recognised kind. Writable turns and the explicit Human Gate
mode are unchanged.

Checks: new local-workspace-permission-policy tests (read-only refusal
matrix, writable approval). Full desktop suite: 1537 pass.
2026-10-15 19:04:42 +08:00