Skip to content

refactor(tests): share the advertised-MCP-tool call - #863

Merged
AlexanderZ-Band merged 4 commits into
mainfrom
fix/acp-process-closure-startup-headroom
Oct 20, 2026
Merged

AlexanderZ-Band merged 4 commits into
mainfrom
fix/acp-process-closure-startup-headroom

Conversation

@AlexanderZ-Band

@AlexanderZ-Band AlexanderZ-Band commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Why

FakeACPAgent carried its own lookup of an advertised MCP server and its own tool call, a copy of what any other ACP test peer needs to do to call a Band tool.

What

tests/mcpclient.py now owns advertised_server and call_advertised_tool, and FakeACPAgent.mcp_server/call_mcp_tool delegate to them, keeping the "was not advertised" error.

Scope

Test-only. The earlier startup-headroom fix for the pipe-holder test is dropped: main's controlled-pipe peer (#831) removes that race.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DksuPncgQrhHzfhqMyGUUW

One transition_timeout_s bounds both the room's startup and the cleanup
the test expects to give up. At 2.0s the real stdio peer's cold start
(~1.2-1.4s on CI) left little margin, so loaded runners abandoned the
start; the finally then missed a not-yet-spawned pipe holder, which kept
stdout open for 120s and surfaced as CleanupIncompleteError.

The peer now runs from a module that imports only acp and the stdlib,
roughly halving its startup; the bound is 5s; and the holder waits on a
release file the test always touches, so it never outlives the test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KoeFsnuQr2KMCP7XfoEkE9
…ocol error

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KoeFsnuQr2KMCP7XfoEkE9

@AlexanderZ-Band AlexanderZ-Band left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cycle 1 review (my-code-review): 1 suggestion, 1 nit, both Test Quality; nothing blocking. Edge-Case and Logical Bugs hypotheses (timing under load, recovery/disposal ordering, holder races, crash-recovery lazy imports) were all reproduced against the real peer with injected startup delays and dropped — none failed or was reachable.

Comment thread tests/integrations/acp/stdiopeer.py Outdated
Comment thread tests/integrations/acp/stdiopeer.py Outdated
FakeACPAgent and the stdio peer both found an advertised MCP server and
called a tool on it; tests/mcpclient.py now owns that once, keeping the
clear not-advertised error for the stdio peer too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KoeFsnuQr2KMCP7XfoEkE9
@AlexanderZ-Band
AlexanderZ-Band requested a balanced review from Copilot October 20, 2026 06:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Main's controlled-pipe peer replaces the stdio peer module and holder-release
file this branch added, so those are dropped; the shared MCP tool-call helper
remains.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DksuPncgQrhHzfhqMyGUUW
@AlexanderZ-Band AlexanderZ-Band changed the title fix(tests): give the ACP pipe-holder test room to start its peer refactor(tests): share the advertised-MCP-tool call Oct 20, 2026
@AlexanderZ-Band
AlexanderZ-Band added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit 9dbd3a6 Oct 20, 2026
43 checks passed
@AlexanderZ-Band
AlexanderZ-Band deleted the fix/acp-process-closure-startup-headroom branch October 20, 2026 08:04
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.

2 participants