Skip to content

Isolate shared MCP state in the Agent Mode handoff test - #501

Open
morluto wants to merge 3 commits into
repoprompt:mainfrom
morluto:test/mcp-agent-isolation
Open

Isolate shared MCP state in the Agent Mode handoff test#501
morluto wants to merge 3 commits into
repoprompt:mainfrom
morluto:test/mcp-agent-isolation

Conversation

@morluto

@morluto morluto commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Problem

The Agent Mode handoff regression test mutates shared MCP, window, and global application state. Without ownership covering the complete setup, assertion, and cleanup lifecycle, another concurrently scheduled suite could observe transient state or begin before cleanup finishes.

Approach

Hold the existing shared-server lease for the test's entire lifecycle and finish deterministic window cleanup before releasing it. Also classify the suite with the canonical serial-group tag so the runner and the test agree about the shared resource.

Changes

  • Hold MCPSharedServerTestLease across setup, assertions, and teardown.
  • Clean up windows before lease release on success and failure.
  • Keep test-only helpers behind #if DEBUG.
  • Use the canonical mcp_shared_server serial-group tag.
  • Normalize ledger tags without changing scenario count.

This does not make the suite parallel-eligible. It makes its required serialization explicit and its cleanup deterministic.

Validation

Repository guardrails, suite-plan classification, and contribution preflights passed. Focused XCTest execution and ledger verification remain macOS CI checks.

@morluto
morluto marked this pull request as ready for review July 11, 2026 06:28
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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