Repository navigation
test(extensions): assert a lease starts its extensions concurrently - #12877
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
|
This pull request has been automatically marked as stale because it has not had recent activity for 23 days. What happens next?
Thank you for your contribution! 🚀 |
Contributor
|
This pull request has been automatically closed due to inactivity. Why was this closed?
Want to reopen?
Thank you for your contribution! We appreciate your effort. 🙏 |
From aaif-goose#6590 until aaif-goose#12730 every MCP extension in a session started one at a time, because the loader held the container mutex across the handshake. aaif-goose#12730 removed the mutex as a side effect and nothing has guarded the parallel start since. Two in-process fixture servers wait on a shared two-party barrier before serving, so a lease can start both only if it starts them at the same time. A lease that started them in sequence never finishes the first handshake and trips the hang guard instead of passing slowly. Starting the slots in a loop instead of join_all fails the test at the guard. Closes aaif-goose#12754. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0133Pm2ydK7ctbyRaXS7Unb1
jamadeo
force-pushed
the
claude/sweet-clarke-nc0o9o
branch
from
December 2, 2026 14:51
6565b9c to
d51fc3d
Compare
jamadeo
approved these changes
Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #12754
Summary
From #6590 until #12730 every MCP extension in a session started one at a time, because the loader held the container mutex across the handshake. #12730 removed the mutex as a side effect; nothing has guarded the parallel start since.
This adds the deterministic test proposed on the issue, using the in-process fixture that #12775 added to the extension manager's own tests rather than stdio subprocesses:
session/newmakes. A lease that started them in sequence never finishes the first handshake and trips the hang guard instead of passing slowly.The barrier is symmetric (each server waits for the other) rather than the A-signals / B-waits / A-waits-for-B-done shape from the issue. It proves the same property, both starts in flight at once, with one fewer signal, and it does not depend on which slot the lease starts first. The timeout is only a hang guard.
Going in-process keeps the test to one file and about forty lines. It exercises the lease's start path, where the regression would live, but not the stdio subprocess spawn; the original lock sat around the whole start and serialized in-process extensions just the same. A stdio variant with the same rendezvous exists if you would rather have subprocess coverage too.
Testing
cargo test -p goose --features scheduler --lib extension_manager::tests::a_lease_starts_its_extensions_concurrentlypasses on main.ExtensionLease::startchanged to start its slots in aforloop instead ofjoin_all, the test fails at the 60s hang guard withthe lease started its extensions one at a time: Elapsed(()).extension_manager::testspasses alongside it.cargo clippy -p goose --features scheduler,acp-http --tests -- -D warningsandcargo fmtare clean.Not an agent-loop change, so the state-machine parity rule does not apply.
Related Issues
Discussion: #12754
🤖 Generated with Claude Code
https://claude.ai/code/session_0133Pm2ydK7ctbyRaXS7Unb1