Repository navigation
Conversation
…output Subagent finalization now waits for the child's outstanding durable background work to be acknowledged before producing the final response.
Adds a non-terminal waiting member to the SessionStatus union and regenerates the client type surface.
Adds Job.pendingFor/Job.awaiting as the shared source of truth for a Session's outstanding durable background work, refactors finalText to use it, and publishes a non-terminal waiting status when a settled Session still has background work to acknowledge. Also supplies the required id in PR anomalyco#49305's background-await test; the adopted diff omitted it and StartInput.id was already required, so the test did not typecheck on this base.
Projects the ephemeral session.status waiting event into the client data layer, maps it through the app session model and UI provider, widens the TUI plugin data type, and shows a waiting label in the TUI footer.
…tion SubagentCompletion.finalText resumed the recovered child via Session.Service.resume, which closes over the outer/global SessionExecution. The recovery tests inject a fresh SessionExecution wired to a test drain reachable only through the layer-provided execution, so the test drain never ran and three SessionRestart background recovery tests hung. Pass a sessions shim whose resume delegates to the layer-provided execution, restoring the layer-wiring contract while keeping finalText's await-background-work behavior.
While background work is outstanding the core publishes `waiting` and withholds `Execution.Succeeded` (releasing the claim), and the TUI treats `waiting` as running/busy so the subagent row shows the spinner instead of the checkmark; the terminal (and tick) appears only after the background work completes.
Remove the `parentID` guard in `sidebarVisible()` so the core sidebar (and its `sidebar.content` slot) renders for subagent sessions.
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
696130b to
c6349d5
Compare
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #45560
Closes #48826
Closes #48548
Type of change
What does this PR do?
A session with outstanding durable background work (a background shell, or a subagent waiting on its child) was reported as idle as soon as its foreground turn ended. Clients then showed the completion tick even though work was still running, a subagent with pending background work was reported to its parent as completed early, and the TUI hid the sidebar for subagent sessions.
This adds a non-terminal
waitingsession status. While a settled session still has pending background work, core publisheswaitingand withholds the terminal event, so clients keep the session active until that work is acknowledged. Subagent finalization awaits the child's pending background notifications before returning its final response. The TUI treatswaitingas busy (spinner, no tick) and renders the sidebar for subagent sessions by removing theparentIDgate.How did you verify your code works?
Ran the focused test files touched by these commits from
packages/core:Result: 64 pass, 0 fail, 366 expect() calls across 3 files.
Coverage lives in
packages/core/test/session-execution.test.ts,packages/core/test/job.test.ts, andpackages/core/test/tool-subagent.test.ts.Screenshots / recordings
N/A (status/behavior change).
Checklist