Skip to content

fix(agents): report a child still opening when Stop agents it called runs - #4786

Merged
devswha merged 3 commits into
mainfrom
fix/opening-child-stop
Nov 26, 2026
Merged

devswha merged 3 commits into
mainfrom
fix/opening-child-stop

Conversation

@devswha

@devswha devswha commented Nov 26, 2026

Copy link
Copy Markdown
Owner

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 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.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

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.

Run configuration

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.

Estimated code review effort: 3 (Moderate) | ~18 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

  • 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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed 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 Passed 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.

Share

Recent review info

Run configuration

Commits

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.

@devswha
devswha merged commit 03d50dd into main Nov 26, 2026
21 checks passed
@devswha

devswha commented Nov 26, 2026

Copy link
Copy Markdown
Owner Author

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.

@devswha
devswha deleted the fix/opening-child-stop branch November 26, 2026 05:12
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.

Stop agents it called can miss a child that is still opening Stop agents it called misses an ACP child whose keeper is still starting

1 participant