fix(acp): degrade gracefully when the agent lacks additional directory support - #86
Merged
Merged
Conversation
…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).
This was referenced Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Production incident (try.mosoo.ai, 2026-07-25)
Every run on the acp-fallback runtime fails after
run.dispatchedwith: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 requestsadditionalDirectories+ agent does not advertisesessionCapabilities.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 returnssessionCapabilities: { close, fork, list, resume }only, andsession/newdoes not readadditionalDirectoriesat all. The old passthrough was a silent no-op; the new gate converts that long-standing silent degradation into a full outage, because mosoo populatesadditionalDirectoriesfor published agents.Fix
Drop the directories when the capability is missing instead of failing the session, and return
droppedAdditionalDirectoriesso 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
/varsymlink case in acp-file-system, green on Linux CI).