Skip to content

g06.034: wire Copilot CLI ACP consumer HTTP MCP - #373

Merged
betterthanclay merged 2 commits into
mainfrom
ns-c9b7f46c-1fff-42d1-92a6-7ff12cb8a415
Sep 25, 2026
Merged

betterthanclay merged 2 commits into
mainfrom
ns-c9b7f46c-1fff-42d1-92a6-7ff12cb8a415

Conversation

@betterthanclay

Copy link
Copy Markdown
Contributor

Summary

  • Wire the consumer-supplied streamable-HTTP MCP entry into copilot-cli.acp production session/new under the reserved name swallowtail-copilot-cli-acp.
  • Prepared facade binds one HTTP placement; omission stays mcpServers: []. Stdio is not offered. SSE is modelled and refused. Name collisions are a typed refusal.
  • client_mcp_servers stays No: emission is proven, live honouring is not.

Test plan

  • cargo fmt -p swallowtail-adapter-copilot-cli -- --check
  • effigy validate:focused swallowtail-adapter-copilot-cli
  • effigy package:verify-affected swallowtail-adapter-copilot-cli
  • effigy qa:routes
  • effigy qa:docs
  • git diff --check

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@betterthanclay

Copy link
Copy Markdown
Contributor Author

Changes required.

  • [P2] Validate prepared MCP placement before restoration can start the provider — crates/swallowtail-adapter-copilot-cli/src/prepared/session.rs:162. prepare_session stores input.http_mcp without validating it. The normal open_session path calls the validating with_http_mcp_placement, but prepare_working_state_restoration attaches the same value through unchecked with_prepared_http_mcp. In driver.rs:244-252, session startup spawns the child and sends initialize before production_mcp_servers rejects an SSE placement, invalid URL/header, or non-reserved name. Thus a malformed prepared input can cause provider work before its typed refusal when restoration is invoked. Validate the placement while preparing the session, or otherwise ensure restoration performs the same refusal before process start; add a provider-free regression check that restoration does not start the child for refused input.

Validation passed: cargo fmt -p swallowtail-adapter-copilot-cli -- --check; effigy validate:focused swallowtail-adapter-copilot-cli (43 tests); effigy package:verify-affected swallowtail-adapter-copilot-cli; effigy qa:routes; effigy qa:docs; git diff --check origin/main...HEAD. Checkout remained clean at exact head 3dd11fed92fb7b1dbfcfc979b1bae8495d0d92cb.

Restoration reused the stored placement through an unchecked constructor, so encode after initialize started the ACP process before typed refusal. Encode first and prove SSE restore never starts the child.

Co-authored-by: Cursor <cursoragent@cursor.com>
@betterthanclay

Copy link
Copy Markdown
Contributor Author

Ready to merge.

The previous P2 finding is resolved. production_mcp_servers now validates and encodes the placement before ProcessService::start, so an invalid or SSE placement on the restoration path returns its typed refusal before the ACP child starts. The provider-free regression test restoration_refuses_invalid_http_mcp_before_process_start verifies the SSE diagnostic, redaction, and that no process starts.

No outstanding findings.

Validation passed on exact head a763e5df2003160eae1c9ba7c41ec89e522d05b4:

  • cargo fmt -p swallowtail-adapter-copilot-cli -- --check
  • effigy validate:focused swallowtail-adapter-copilot-cli (44 tests)
  • effigy package:verify-affected swallowtail-adapter-copilot-cli
  • effigy qa:routes
  • effigy qa:docs
  • git diff --check origin/main...HEAD

The checkout is clean at the expected head.

@betterthanclay
betterthanclay merged commit e0080d4 into main Sep 25, 2026
11 checks passed
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