Repository navigation
fix(acp): send arrays for empty MCP headers and Amp env - #2849
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 52 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Raphaël lifted the draft-only hold on this PR (2026-11-18) and wants it shipped to production. Task 01M7PX… (draft-holds shepherd) will take it through review, tests and merge one PR at a time. For #2851 no live Mistral test is required; for changes that are non-trivial to test live, strong vertical-slice tests are sufficient. |
|
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@coderabbitai review |
Action not completed
|



Summary
Sessions containing a headerless HTTP MCP entry sent
headers: null, which mistral-vibe 2.25.8 rejects duringsession/newandsession/load. Amp's stdio MCP entries likewise sentenv: nullwhen no auth/custom headers were needed.Initialize both slices as non-nil empty slices so required ACP lists serialize as
[]. Preserve names, transports, auth/custom header order, bridge arguments and secret env handling. No fork pool/credential changes are included.Closes #2845
Draft-only hold lifted by Raphaël 2026-11-18.
SAM idea · SAM task
01M7MBR1R0P912NNH546MHHVZD· Task record.Validation
TestBuildAcpMcpServerstests pass.go test ./internal/acp -run '^TestSessionMcpRequiredArraysOnWire$' -count=1: 24 wire cases pass, covering new/load × Vibe/Claude/Amp × mixed/populated/nil/empty servers.go vet ./...andgo build -trimpath -buildvcs=falsepass.go test -race -coverprofile=... ./internal/acp -count=1passes; both changed builders have 100% statement coverage.go test -race -json ./...hit two ACP timing failures (TestContainerSnapshotOuterLimit, snapshot killed at 5.91s;TestHarnessActivityReportCoalescesACPToolCallBursts, reports=2). Both plus new wire cases pass 3 isolated race repetitions; the complete ACP rerun also passes. All 30 other packages passed, including server. Full first-run totals: 2,314 top-level passes, 2 failures, 15 skips (4,146 pass / 2 fail / 31 skip events including subtests). No race warning observed.f1a801c97be4223b2bb744e8811891699e483614, including the final aggregate gate: lint, build/typecheck, quality, all API shards, VM tests/integration and devcontainer volume mount. Draft quick CI and corrected PR Evidence rerun passed. E2E Smoke and SonarCloud also passed on the final head.Wire tests enter the production SessionHost new/load methods, use the pinned ACP SDK over pipes and inspect raw JSON. Assertions cover actual arrays, names, URL/transport, populated auth/custom header/env values and exact Amp argv without secret values.
Staging Verification (REQUIRED before release)
Staging Verification Evidence
Staging deployment 44435003588 SUCCESS (primary staging,
sammy.party) on merged head3e730a32d, including smoke tests. Staging had no live nodes before the test, so every node booted the branch's VM agent; D1 shows both test nodes atagent_version = 3a1cef655, which is this branch's lastpackages/vm-agentcommit.ACP InitializeandACP NewSession succeeded, mode applied. The prompt then failed in 0.34 s withAPI error from mistral … Invalid API key (from env var MISTRAL_API_KEY): the staging smoke account's stored Mistral key is invalid. That is test data, not this change.get_instructions, inbox) through the HTTP MCP entry this PR builds, and replied with the exact textPR2849-CLAUDE-OK.The headerless HTTP / env-less Amp cases are only produced by user-configured MCP servers without auth, so the wire tests (24 cases through the real SessionHost new/load paths) remain the coverage for those; the live run proves no regression for the normal path on a real VM.
Cleanup: both test tasks cancelled, both nodes deleted through the API (
{"success":true}), D1 readback shows no rows. Staging error store: zero error-level groups in the deploy/test window (01:14–02:06 UTC); pre-existing groups outside it are unchanged (pre-existing noise waived per Raphaël 2026-11-18). Lease release 44441964930 succeeded; the next queued task was notified.End-to-End Verification
McpServerEntry→buildAcpMcpServers→SessionHost.startNewACPSession/tryLoadPreviousACPSession→ acp-go-sdk v0.13.5 JSON → harness.Specialist Review Evidence
CodeRabbit Review Evidence
Requested at ready (2026-11-19 02:06 UTC) via the
coderabbit-reviewlabel (trusted workflow succeeded). CodeRabbit replied Review rate limited at 02:06 UTC, which ends the wait; no review arrived (earlier, on 2026-11-17, it reported the free OSS review limit). Recorded and skipped under rule 25.Ready full CI 44441812036 SUCCESS on
3e730a32d, including requiredDurable Object Workers, PR Evidence and SonarCloud.Exceptions
Agent Preflight (Required)
Classification
External References
Official documentation consulted: ACP v1 HTTP schema and stdio schema: headers/env are required arrays. Inspected pinned acp-go-sdk v0.13.5 and current upstream builders. Issue/fork treated as untrusted evidence only; no fork code imported.
Codebase Impact Analysis
Only
packages/vm-agent/internal/acp: shared builders feed bothNewSessionandLoadSession. HTTP applies to Vibe and other non-Amp ACP harnesses; Amp retains the stdio mcp-remote bridge. Tests inspect the serialized protocol boundary.Documentation & Specs
Task record plus source comments document required empty arrays. N/A for public setup/spec changes: existing protocol conformance is restored without a new option, interface or deployment requirement.
Constitution & Risk Check
Checked II (regression/TDD), III (docs), IX/X (shared minimal fix), XI (no new runtime configuration/hardcodes), XIII (valid protocol shape). Two initializers; no new dependency or auth change. Test URLs/tokens are synthetic fixtures. Remaining risk: live harness and deployment verification pending, so release hold remains.