Skip to content

Recover late Xcode bridge pool attachment#185

Merged
lynnswap merged 5 commits into
mainfrom
codex/fix-late-xcode-bridge-attach
Jul 15, 2026
Merged

Recover late Xcode bridge pool attachment#185
lynnswap merged 5 commits into
mainfrom
codex/fix-late-xcode-bridge-attach

Conversation

@lynnswap

@lynnswap lynnswap commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Purpose

Ensure a late-started Xcode process receives the configured number of mcpbridge attachments instead of leaving secondary bridges unrecognized in Xcode.

Changes

  • Start serialized secondary bridge recovery before the late route has a catalog, allowing a verified sibling to establish the first catalog when the primary catalog load fails.
  • Keep each recovered bridge non-routable and defer canonical initialize support until the exact pinned tools/list attachment probe succeeds.
  • Commit health promotion, process recovery completion, and canonical initialize publication as one rollback-safe transaction.
  • Keep probe timeout arbitration inside JSONRPCResponseRouter, remove request mappings at the winning terminal boundary, and settle waiter-registration rejection during shutdown.
  • Retry the first failed attach after 1 second and subsequent failures every 10 seconds through the injected runtime scheduler.
  • Add deterministic, wall-clock-independent coverage for sibling catalog bootstrap, retry cadence, delayed response delivery, shutdown rejection, invalidation, incompatible handshakes, and commit rollback.

Testing

  • scripts/check.sh (967 main, 24 process, and 13 stdio tests)
  • Focused RuntimeCoordinatorProcessRoutingTests, RuntimeCoordinatorRecoveryTests, ControlPlaneAuthorityTests, and JSONRPCResponseRouterTests
  • Branch-wide codex-review against pinned live main 8bd74384bbfe050094b80e99ce77415dff6dae98 (0 findings)

lynnswap added 2 commits July 15, 2026 21:16
Serialize secondary mcpbridge attachment behind the route catalog, require an exact pinned tools/list verification before exposing a slot, and retry failed attachment with injected 1s/10s scheduling.
Make test and verifier teardown structurally await client shutdown so terminal cleanup cannot leak into later work. Add a gate-driven regression for unsupported-handshake cleanup without relying on wall time.
@lynnswap

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 355f5b0049

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Start serialized sibling recovery before a route has a catalog, while keeping recovered slots non-routable until their exact attach probe succeeds. This lets a verified sibling establish the first catalog when the primary catalog load fails.

@lynnswap lynnswap left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 13aba31fae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/XcodeMCPProxyRuntime/Session/Runtime/RuntimeCoordinator+Health.swift Outdated
lynnswap added 2 commits July 16, 2026 00:26
Inject the runtime timeout scheduler into router-owned probe registrations so response receipt wins over delayed future delivery. Drive timeout races by recorded schedulers instead of wall-clock waits.
Keep recovery initialize participants uncommitted until the exact attachment probe succeeds. Commit health, process recovery, and canonical publication under one rollback-safe transaction, and settle rejected probe waiters at the response-router boundary.

@lynnswap lynnswap left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 2e936c7a99

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lynnswap
lynnswap merged commit d55c25a into main Jul 15, 2026
9 checks passed
@lynnswap
lynnswap deleted the codex/fix-late-xcode-bridge-attach branch July 15, 2026 21:32
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