You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(agents): report a child still opening when Stop agents it called runs - #4786
Fixes#4677. Fixes#4626. Stop agents it called (POST /api/pane/turn/cancel-children) held only the ACP children whose session was already open. A child whose keeper terminal existed but whose ACP session was still opening (or whose terminal-create answer had not come back yet) appeared in neither held nor failed, so the person was told everything stopped while that child went on to receive its initial task.
Now the children that are opening when the stop begins are recorded at that moment and reported in the existing failed list, even if one finishes opening while the stop is still running. The answer's shape is unchanged; the sidebar already says "Some agents it called were not stopped. Try again." for a failed entry.
Known limits (pre-existing, not changed here): a keeper that never answers a hold has no deadline, and the sidebar cannot yet tell an opening ACP child from a plain child terminal, so its Stop/Try again entries are unchanged.
Validation
New regressions (an opening child left out of the receipt; a child that finishes opening during the stop shown as held) fail on origin/main and pass here; 79 focused tests (children, cancel-children, AgentSidebar) and bun run typecheck pass.
bun run check fast at 656c2f0: green (remote heavy runner).
Reviews: omo gate CLEAR on the first head; Codex (3 MEDIUM) - the race fixed in 656c2f0, the other two are the pre-existing limits above.
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Bug Fixes
Stopping a pane’s agents now reports children that were still opening when the stop began, even if they become ready before the response arrives. These children are listed as failed rather than held; ready children continue to be reported according to the hold result.
The change tracks children while their ACP sessions are opening. The cancel-children endpoint attempts holds for ready children and reports opening children as failed.
Changes: Opening child stop reporting
Layer / File(s)
Summary
Track and query opening children server/acp/children.ts, server/acp/children.test.ts
AcpChildren records child starts in progress. childrenOf returns matching children in separate ready and opening arrays. Tests cover the new result shape and a child that becomes ready while the query waits.
Include opening children in stop results server/dispatch.ts, server/agent-tools/stop.contract.test.ts, changelog.d/opening-child-stop.md
The cancel-children handler attempts holds for ready children and includes opening terminals in failed. A regression test checks the response while a child session is opening.
devswha/ovis#4624: Introduces the cancel-children endpoint and its held and failed response fields.
Merge Risk: Minimal · previous review 656c2
Stopping a pane's agents now reports children that were still opening, including ones that finish opening while the stop runs. The response shape is unchanged and the sidebar already shows "Try again" for a failed entry. No concrete merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: children still opening when Stop agents it called runs are now reported. It matches the changeset, which records opening children and reports them in the failed list o…
Description check
The description covers the Change section with the problem, the resulting behavior, and linked issues #4677 and #4626. The Validation section lists the focused tests, the typecheck, and the remote fas…
Linked Issues check
Objectives [#4677, #4626]: a child that is opening when bulk stop begins must be held or reported in failed. Head server/acp/children.ts records each start in this.opening (keyed by child id and…
Out of Scope Changes check
Changed files are server/acp/children.ts (opening tracking and the childrenOf return shape), server/dispatch.ts (receipt built from opening and ready), tests in server/acp/children.test.ts…
Full details: Title check
Explanation
The title names the main change: children still opening when Stop agents it called runs are now reported. It matches the changeset, which records opening children and reports them in the failed list of /api/pane/turn/cancel-children. The title is specific and uses the conventional prefix format.
Full details: Description check
Explanation
The description covers the Change section with the problem, the resulting behavior, and linked issues #4677 and #4626. The Validation section lists the focused tests, the typecheck, and the remote fast check, plus the review outcomes. It notes the pre-existing limits. It does not state which contract-test coverage applies, although the endpoint is HTTP and the template asks for that. The check runs fast rather than full, and the description does not say whether the full check was skipped. These are minor gaps, so the description is mostly complete.
Full details: Linked Issues check
Explanation
Objectives [#4677, #4626]: a child that is opening when bulk stop begins must be held or reported in failed. Head server/acp/children.ts records each start in this.opening (keyed by child id and parent pane) before terminal.run is called, and removes it in finally. This covers a child whose terminal-create answer is still pending. childrenOf snapshots this.opening at call start. A live terminal under the parent whose id was opening at that snapshot is returned in opening and never offered a hold, even if it finishes opening during the wait. The change summary states that server/dispatch.ts adds every opening terminal to failed, and the summary also lists a test in server/agent-tools/stop.contract.test.ts for a terminal that is live but still opening. Both issues are satisfied by reporting in failed. #4626 names the launch ledger only as a possible approach, so its absence is not a failure. Residual uncertainty: childrenOf lists terminals once. A terminal.run still in flight at the snapshot may not appear in that list, which depends on core request ordering. I did not verify that ordering. The diff tool was unavailable, so the dispatch.ts change rests on the supplied summary.
Full details: Out of Scope Changes check
Explanation
Changed files are server/acp/children.ts (opening tracking and the childrenOf return shape), server/dispatch.ts (receipt built from opening and ready), tests in server/acp/children.test.ts and server/agent-tools/stop.contract.test.ts, and changelog.d/opening-child-stop.md. Each connects to the stop-receipt objectives of #4677 and #4626. The childrenOf return-shape change is required by the new opening list, and its callers are updated. The PR description excludes the sidebar change and the no-deadline hold limit, and the diff contains no such change. No unrelated change was found in the supplied evidence.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between e646a0c and 656c2f0.
Files selected for processing: 5
changelog.d/opening-child-stop.md
server/acp/children.test.ts
server/acp/children.ts
server/agent-tools/stop.contract.test.ts
server/dispatch.ts
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.
Merged through pr-merge at head 515f00651. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit reviewed this head.
main had moved since the checks of 656c2f0c8: pr-merge --update merged it in (e646a0ca8), and every required check was green at this head.
main moved but untouched: merged without update. Its new commits up to 33c838667 change no file of this pull request, none imported by one, nothing that decides which checks run, and no core path.
Reviews: omo gate CLEAR (first head); Codex gpt-6.2-sol-fast xhigh found 3 MEDIUM: the race fixed in 656c2f0 with a failing-first test, two pre-existing limits documented; check fast green. Touches an HTTP route's receipt membership only (shape unchanged). Merged by lane issue-fix-1126 on the lead's word.
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
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.
Change
Fixes #4677. Fixes #4626. Stop agents it called (
POST /api/pane/turn/cancel-children) held only the ACP children whose session was already open. A child whose keeper terminal existed but whose ACP session was still opening (or whose terminal-create answer had not come back yet) appeared in neitherheldnorfailed, so the person was told everything stopped while that child went on to receive its initial task.Now the children that are opening when the stop begins are recorded at that moment and reported in the existing
failedlist, even if one finishes opening while the stop is still running. The answer's shape is unchanged; the sidebar already says "Some agents it called were not stopped. Try again." for afailedentry.Known limits (pre-existing, not changed here): a keeper that never answers a hold has no deadline, and the sidebar cannot yet tell an opening ACP child from a plain child terminal, so its Stop/Try again entries are unchanged.
Validation
bun run typecheckpass.bun run check fastat 656c2f0: green (remote heavy runner).