Skip to content

test(extensions): assert a lease starts its extensions concurrently - #12877

Merged
jamadeo merged 1 commit into
aaif-goose:mainfrom
thisguycodes:claude/sweet-clarke-nc0o9o
Dec 2, 2026
Merged

jamadeo merged 1 commit into
aaif-goose:mainfrom
thisguycodes:claude/sweet-clarke-nc0o9o

Conversation

@thisguycodes

@thisguycodes thisguycodes commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • Two fixture servers wait on a shared two-party barrier before they serve, so a lease can start both only if it starts them at the same time.
  • The test selects both on a session and starts its first lease, the same call session/new makes. 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_concurrently passes on main.
  • With ExtensionLease::start changed to start its slots in a for loop instead of join_all, the test fails at the 60s hang guard with the lease started its extensions one at a time: Elapsed(()).
  • Every test in extension_manager::tests passes alongside it.
  • cargo clippy -p goose --features scheduler,acp-http --tests -- -D warnings and cargo fmt are 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

@thisguycodes
thisguycodes requested a review from a team as a code owner October 13, 2026 17:43
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T14:53:40.715593Z d51fc3d New commits
ℹ️ 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.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity for 23 days.

What happens next?

  • If no further activity occurs, this PR will be automatically closed in 7 days
  • To keep this PR active, simply add a comment, push new commits, or add the keep-open label
  • If you believe this PR was marked as stale in error, please comment and we'll review it

Thank you for your contribution! 🚀

@github-actions github-actions Bot added the stale label Nov 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed due to inactivity.

Why was this closed?

  • No activity for 30 days total (23 days + 7 day grace period)
  • Marked as stale 7 days ago with no subsequent activity

Want to reopen?

  • You can reopen this PR at any time if you want to continue working on it
  • Consider rebasing against the latest main branch before reopening
  • Feel free to reach out if you need any assistance

Thank you for your contribution! We appreciate your effort. 🙏

@github-actions github-actions Bot closed this Nov 19, 2026
@jamadeo jamadeo reopened this Dec 2, 2026
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
jamadeo force-pushed the claude/sweet-clarke-nc0o9o branch from 6565b9c to d51fc3d Compare December 2, 2026 14:51
@jamadeo
jamadeo enabled auto-merge December 2, 2026 14:55
@jamadeo
jamadeo added this pull request to the merge queue Dec 2, 2026
Merged via the queue into aaif-goose:main with commit 009dc1c Dec 2, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extensions loaded serially for 9 months; fixed by accident in #12730, no test

3 participants