Skip to content

fix(core): tell parents their subagents resumed after restart - #62637

Open
opencode-agent[bot] wants to merge 2 commits into
devfrom
restart-notice-subagents
Open

opencode-agent[bot] wants to merge 2 commits into
devfrom
restart-notice-subagents

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

N/A, reported in Slack.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

After a server restart, every interrupted session gets the same "Continuing after restart" notice: "Continue from where you left off without repeating completed work." Restart recovery also relaunches a parent's running subagents in the background. The notice doesn't say that, so the parent often tries to resume or relaunch them itself.

When at least one of a parent's subagents was actually resumed (or is already running), the parent's notice now adds: "Subagents have resumed automatically." Subagents that ran out of their resume budget don't count, because they report an error instead. Sessions without resumed subagents, including the subagents themselves, still get the original text.

How did you verify your code works?

  • The subagent recovery test in session-execution.test.ts now checks the notice text for both the parent and the child. It fails without the change and passes with it.
  • bun test test/session-execution.test.ts: 36 pass.
  • tsc -b tsconfig.tests.json in packages/core passes. oxlint and prettier are clean on the changed files.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Requested by: @Hona (Hona via Slack)


Added by the opencode bot (AI-generated).

Related: #36349

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks sound. I ran the session execution tests: the updated recovery test fails against the base restart.ts and passes with this change, and tsc for packages/core is clean. The parent is only flagged when a child was actually resumed or is already active, so children that ran out of their resume budget still report an error as before. The change stays inside restart recovery.

Public API: unchanged (only the wording of the restart notice sent to the model changes).

No blocking concerns.

Related: #36349

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new commit only shortens the parent's extra notice to "Subagents have resumed automatically." and updates the test's expected text. The logic is unchanged. The session execution tests and tsc for packages/core still pass.

Public API: unchanged.

No concerns.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant