Skip to content

fix(acp): degrade gracefully when the agent lacks additional directory support - #86

Merged
Yevanchen merged 1 commit into
mainfrom
fix/acp-additional-dirs-degrade
Jul 25, 2026
Merged

fix(acp): degrade gracefully when the agent lacks additional directory support#86
Yevanchen merged 1 commit into
mainfrom
fix/acp-additional-dirs-degrade

Conversation

@Yevanchen

Copy link
Copy Markdown
Collaborator

Production incident (try.mosoo.ai, 2026-07-25)

Every run on the acp-fallback runtime fails after run.dispatched with:

ACP session setup failed: ACP agent does not advertise additional directory support.

Started when the mosoo pin moved to driver 9d4415d (langgenius/mosoo#399, deployed 07-24 ~14:45Z). Reproduces for all published agents, all models, with/without MCP, restartDriver ineffective — the failure is in capability negotiation, upstream of all of those.

Root cause

Contract v2 (#54) added a hard gate in acp-session-setup.ts: session requests additionalDirectories + agent does not advertise sessionCapabilities.additionalDirectories → throw. The previous driver passed the field through unconditionally.

OpenCode — the acp-fallback agent — has never advertised that capability. Verified against sst/opencode v1.18.4 packages/opencode/src/acp/service.ts: initialize returns sessionCapabilities: { close, fork, list, resume } only, and session/new does not read additionalDirectories at all. The old passthrough was a silent no-op; the new gate converts that long-standing silent degradation into a full outage, because mosoo populates additionalDirectories for published agents.

Fix

Drop the directories when the capability is missing instead of failing the session, and return droppedAdditionalDirectories so the backend logs the degradation (driver.acp.session.additional_directories_dropped, warn). Behavior with capability-advertising agents is unchanged — covered by a new regression test in both directions (dropped when unsupported, passed through when supported).

Tests: 1078 pass locally (1 known macOS-only /var symlink case in acp-file-system, green on Linux CI).

…y support

Contract v2 added a hard failure when the session requests
additionalDirectories and the ACP agent does not advertise
sessionCapabilities.additionalDirectories. OpenCode has never advertised
the capability (its initialize returns only close/fork/list/resume) and
ignores the field entirely, so the old driver's unconditional passthrough
was a silent no-op. The strict gate therefore turned every published-agent
run on the acp-fallback runtime into
'ACP session setup failed: ACP agent does not advertise additional
directory support.' in production.

Drop the directories instead of failing the session and report them back
so the backend can log the degradation
(driver.acp.session.additional_directories_dropped).
@Yevanchen
Yevanchen merged commit 020cfae into main Jul 25, 2026
2 checks passed
@Yevanchen
Yevanchen deleted the fix/acp-additional-dirs-degrade branch July 25, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant