Repository navigation
fix(agency): a launch stays closing while a team its seats launched holds a seat, and agency() warns about agencies - #644
Conversation
…osing while its seat outlives the grace
…none of its seats
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Warn on unused agency options src/api/agency.ts, src/api/__tests__/agency-gmi-seats.e2e.test.ts, docs/AGENCIES.md |
agency() warns when runtime options include a non-null agencies value. The test checks the warning and verifies that agency seats are not offered launch_agency. The documentation describes where to configure agencies for team launches. |
Nested launch lifecycle
| Layer / File(s) | Summary |
|---|---|
Wait for nested launch removal src/api/runtime/agencyLaunch/launchRegistry.ts, src/api/runtime/agencyLaunch/runLaunch.ts, src/api/runtime/agencyLaunch/__tests__/runLaunch.test.ts, src/api/__tests__/agency-launch-nested-closing.gmi.e2e.test.ts |
launchRegistry tracks nested launches and removal waiters. runAdmitted waits for nested launch entries to be removed before removing the parent entry. Tests check closing states, concurrency refusal while seats remain held, and successful launch after cleanup. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant runAdmitted
participant launchRegistry
participant NestedSeat
runAdmitted->>launchRegistry: Find launches nested under the parent
launchRegistry-->>runAdmitted: Return registered nested launches
runAdmitted->>launchRegistry: Wait for nested launch removal
NestedSeat->>launchRegistry: Release held work and remove nested launch
launchRegistry-->>runAdmitted: Resolve removal waiter
runAdmitted->>launchRegistry: Remove parent launch entry
Possibly related issues
- framerslab/agentos#626 — The changes affect nested team launch behavior, but the issue’s limits, budgets, and gates work remains outside this change.
Possibly related PRs
- framerslab/agentos#382 — Introduced
launchRegistryandrunLaunch, which this change extends for nested launch cleanup. - framerslab/agentos#631 — Addresses launch lifecycle and held-seat cleanup behavior that this change extends to nested launches.
Merge Risk: 
Minimal · up to b78b6
-
Nested cleanup preserves timed-out responses. The change is mergeable after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description is thorough and follows the template. It has a Summary that explains two fixes: a nested team launch now holds its root launch's registry entry while its seats are held, and agency() now warns when it receives agencies. Linked issues is None. The Type of change, How this was verified, Migration notes, and Checklist sections are all filled in. The verification section names the three test files and what each checks, and the Migration notes section says no type changes are made. The Summary by Sourcery block is extra and does not affect the check. The description matches the raw summary and the objectives.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 6 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
Codex Review SummaryThis 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. |
Reviewer's GuideThis PR fixes launch-registry cleanup so a parent launch remains File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
PR Summary by Qodotest(agency): cover nested launch cleanup and ignored agencies options
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7deb4d2d2a
ℹ️ 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".
…s to none of its seats
…hreads-read-T20-T21
|
On the docstring coverage check: every source function this change touches has its doc comment ( |
Summary
A read of
launch_agency's closing entry and of theagenciesoption found two places where the code does less than its rule says:closingin the launch registry and counts toward its scope'smaxConcurrent, so a session's retry against a tool that hangs past the deadline is refused (concurrency_exceeded) instead of seating another member. A team that one of the launch's seats launched (a nested launch, whose scope is the launch it came from) is held the same way, but the launch it came from was removed as soon as its own seats were released. With the defaults (maxDepth2), a lead seat whose team's waiter calls a tool that hangs left the lead's teamclosingand the root launch gone: the session's next launch was admitted, and each retry seated one more waiter on the same hanging tool. A launch's entry now staysclosinguntil every launch nested under it is removed as well.agency()dropsagencieswithout a word.agenciesis agmi()option: an agency launches no team itself and passes the option to none of its seats.AgencyOptionsdoes not declare it, so a TypeScript literal is refused, but a JavaScript caller, or a host that spreads an agent's options object intoagency()'s (a spread's properties are not checked against the target type), had it ignored in silence.agency()now warns, as it does forcognitiveMechanisms.Linked issues
None.
Type of change
How this was verified
CI on this pull request: the tests were pushed ahead of the fixes and read red, then the fixes.
src/api/__tests__/agency-launch-nested-closing.gmi.e2e.test.tsruns the realgmi(),agency(), launch engine, completion gateway, GMI and tool orchestrator with only the provider classes stubbed: a root launch's lead seat launches a team whose waiter's tool hangs past the deadline; after the root launch returnstimed_outand its lead is released, the root launch is stillclosing, the session's next launch is refusedconcurrency_exceeded, and once the tool returns both entries go and the session launches again.src/api/runtime/agencyLaunch/__tests__/runLaunch.test.tsholds the same rule on the engine with a fake host and fake seats.src/api/__tests__/agency-gmi-seats.e2e.test.ts: an agent's options spread intoagency()withagenciesset warn at construction, and the agency's GMI seat runs with nolaunch_agencyoffered.Migration notes
None. No type changes; a launch nested under another holds its parent's entry only while its own seats are held.
Checklist
!before the colon for a change that breaks users (feat!:orfeat(api)!:).Summary by Sourcery
Preserve launch concurrency limits across nested launches and surface ignored agencies configuration in agency().
Bug Fixes:
Documentation:
Tests:
Summary by CodeRabbit
Bug Fixes
agenciesoption they do not apply to themselves or their seats. Configure this option on agmi()agent that may launch teams.Documentation