Skip to content

Make control-plane and repair waits deterministic - #193

Merged
lynnswap merged 3 commits into
mainfrom
codex/stabilize-ci-async-waits
Sep 3, 2026
Merged

Make control-plane and repair waits deterministic#193
lynnswap merged 3 commits into
mainfrom
codex/stabilize-ci-async-waits

Conversation

@lynnswap

@lynnswap lynnswap commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Purpose

CI runs 33609497643 and 33696791792 exposed scheduler-dependent control-plane tests on the macOS 26 runner.

The second failure confirmed that the prewarm test registered two independent refresh tasks: initialization already schedules the configured prewarm, and the test scheduled it again. A delayed duplicate could enter after the first load timed out and legitimately create a second load. The same path also allowed an already-expired request to start a load before its observer was rejected.

Make load creation reject expired work, and make the timeout and promotion tests advance only through explicit actor-owned state transitions.

Changes

  • Reject expired tools-catalog, prewarm, and window requests before starting a control-plane load; cancel a newly created load if its deadline expires before the first waiter can be registered.
  • Remove redundant manual prewarm triggers and wait for the single initialization-owned prewarm completion event.
  • Add test-only projections of the ControlPlaneCoordinator load identity, waiter membership, and cancellation handle.
  • Drive timeout tests by firing the exact registered waiter on the owner actor instead of advancing several timers together.
  • Drive promotion tests with a fully virtual clock and assert loadID / waiter transitions rather than upstream message counts or cancellation delivery order.
  • Let the documentation repair waiter own its operation and timeout tasks directly, preserving single completion and cancellation without a separate relay task.

Review focus

  • No control-plane load should survive without an observer when its deadline is already expired.
  • The deterministic tests use ControlPlane.DebugMirror only as an event barrier, then inspect the actor-owned load identity and waiter set as the source of truth.
  • Promotion follows L1 -> L2, sharing preserves L2, and cancellation removes waiters as 2 -> 1 -> 0 without depending on executor speed.

Testing

  • Xcode 26.6 / Swift 6.3.3 CI-equivalent test bundle:
    • package suite: 1,074 tests passed
    • XcodeMCPProcessRuntimeTests: 24 tests passed
    • ProxyStdioAdapterTests: 13 tests passed
  • Xcode 27.0 RuntimeCoordinatorRecoveryTests|RuntimeCoordinatorWindowRoutingTests: 95 tests passed
  • ./scripts/verify-proxy-target-boundaries.sh
  • git diff --check
  • Branch-wide Codex review against main: clean, 0 findings
  • GitHub Actions run 33699359570: all 9 checks passed

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@lynnswap

lynnswap commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-03T00:36:28.299238Z b37c7e5 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: f43ad60a69

ℹ️ 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 changed the title Stabilize control-plane promotion and repair waits Make control-plane and repair waits deterministic Sep 3, 2026
@lynnswap

lynnswap commented Sep 3, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: b37c7e56e8

ℹ️ 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 5659e3e into main Sep 3, 2026
9 checks passed
@lynnswap
lynnswap deleted the codex/stabilize-ci-async-waits branch September 3, 2026 00:37
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