Skip to content

fix(native-chat): settle refused helpers after the status store fills - #28829

Closed
brennanb2025 wants to merge 3 commits into
mainfrom
brennanb2025/sta-10504-overflow-rederive
Closed

brennanb2025 wants to merge 3 commits into
mainfrom
brennanb2025/sta-10504-overflow-rederive

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

When the agent-status store was full (it holds at most 8,192 helper records), it refused records for extra background helpers. Orca remembered at most 512 refused helper IDs. If a chat had more than that, the background-task strip could keep saying details were unavailable even after every helper finished, because Orca no longer knew which refused helpers had ended.

What Changed

Orca now remembers each refused helper until that helper is admitted into the store or reports its end. After the last one ends, incomplete tracking clears and the existing background-task strip returns to its normal state. A user-initiated Stop and the provider session's end still clear all remembered helpers.

User-facing before and after:

  • Ordinary chats: no difference.
  • A chat that had more than 512 refused helpers, after all of them ended: on main the strip keeps saying tracking is incomplete until the agent session ends; with this PR it clears after the last helper ends.

Why

The old 512-helper overflow marker could clear only when the whole agent session ended. Remembering the actual helper IDs lets the host settle each one from its own end event. A time limit was considered and rejected: it would risk forgetting a helper that is still working. The retained set grows with the number of distinct refused helpers whose end the host has not seen; it has no fixed count cap. If a provider never sends a helper's end, the session end or manual Stop clears it. This base change is separate so the idle-sweep fix in #28812 can rely on an accurate incomplete signal.

How this differs from the common pattern (INTENDED): the common pattern derives owed child work from one provider-reported roster of children. Here, admitted children live in the bounded display status store and the exact set of refused helpers is kept beside it by the execution host. Intended because generic ACP agents expose no helper signal and Grok exposes only bounded projections, so the exact refused-helper set is the host-owned truth under the display store's cap. A provider-reported child-work model that gives every reader one execution-owned source for all children is a possible later refactor.

Linked Issue

STA-10504

Visual Proof

This change adds no UI element; it clears an existing strip state after an unusually large group of helpers ends, which is covered by the automated test below. Hidden-window QA ran on the full stack (this PR plus #28812 at commit 05a4c08, before main was merged in) against main on a separate Mac with real Claude Code and showed no user-visible difference for a short prompt, a long command stopped with Stop, and one subagent. The side-by-side screenshots are in #28812's Visual Proof.

Testing

  • Automated: the real-store status-owner test fills all 8,192 child slots, refuses 513 more helpers, and verifies that incomplete tracking remains until the 513th end, then clears (11 tests in the affected file pass).
  • Manual: hidden-window Electron QA on macOS (M4Air) of the stack, as described above.
  • CI: the full PR workflow, including the PR checks passed aggregate, passes on the current head (1517715). The commits after 7df5a64 only merge in current main, with no conflicts.

Review

Reviewed as the base of the #28812 stack: three adversarial rounds plus an architecture challenge. This exact-tracking change resolved both findings those rounds raised (a sticky overflow marker, and a proposed expiry that could forget a live helper). No open correctness findings remain.

Agent skill upstream boundary

  • Not applicable.

Notes

No saved field, remote wire field, path, shortcut, or platform-specific operation changes. The execution host owns this state for local, folder, and SSH workspaces. Linux and Windows are covered by CI only.

Checklist

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review loop status: code review passed, CI green, QA passed

Problem. Orca's agent-status store holds at most 8,192 helper (subagent) records per host and refuses records beyond that. Orca remembered at most 512 of the refused helpers. If more than 512 were refused, the background-task strip kept saying tracking was incomplete even after every helper had finished, because Orca could no longer tell which refused helpers had ended. This also made the "incomplete" signal unreliable for the idle-cleanup fix in #28812.

User-facing change. After the last refused helper ends, the strip goes back to normal instead of staying "incomplete" until the agent session ends. Ordinary chats behave exactly as before.

What was fixed. The host now remembers each refused helper by its exact ID until that helper is admitted, ends, or its session ends. Stop and session end still clear everything. A time-based expiry was considered and rejected because it could forget a helper that is still working. Nothing is deferred.

What was verified.

Not verified / remaining risks.

  • The 513-helper scenario was not driven live. It is covered by the real-store test.
  • Linux, Windows and SSH were checked by CI only. The change adds no saved field or wire message.
  • Memory grows with the number of refused helpers that have not reported an end. A provider that never reports an end is cleared by session end or Stop.
  • Admitted and refused helpers are tracked in two places on the host. This is intended for now (see the description). Moving to one provider-reported list of child work is a possible later refactor.

@brennanb2025
brennanb2025 marked this pull request as ready for review October 16, 2026 04:07
@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: be1ff0ca-88ec-4148-9764-4829acd8e0e3
📥 Commits

Reviewing files that changed from the base of the PR and between 82a2414 and 1517715.

📒 Files selected for processing: 2
  • src/main/native-chat/agent-session-wire/structured-agent-session-status-ownership.test.ts
  • src/main/native-chat/agent-session-wire/structured-agent-session-status-ownership.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

📝 Walkthrough

The per-session refusal map now stores an unbounded set of refused child handles. Refusal state remains while the set contains handles and clears when the final handle reports an end. The test checks that incompleteness remains after the first 512 of 513 child-end reports and clears after the final report.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 15177

Refused helpers remain tracked until their work ends, and no actionable merge-blocking risk remains after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title is concise, specific, and accurately describes the main change: settling refused helpers after the bounded status store fills.
Description check Passed The description is complete and focused. It explains the user impact, implementation, rationale, linked issue, testing, review status, platform considerations, and visual-proof exception. The reported…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • 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

Comment @coderabbitai help to get the list of available commands.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Closing: this patches the status store's size limits, which are themselves wrong. The fix is moving to the root of that store in a separate change.

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.

1 participant