GeezerVison is showing github.com — fix(core): persist subagent session id before child starts by OpeOginni · Pull Request #53188 · anomalyco/opencode
Conversation
OpeOginni
commented
Oct 4, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Issue for this PR
Closes #36349
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
- If the server dies while a subagent runs, the parent loses the child's session ID, because the subagent tool only reports it through
context.progress, which is never stored.
- On restart, the runner already adds
metadata.sessionID to the "Tool execution interrupted" error, but the stored tool part never had it, so the main agent could not continue the child.
- Adds a small
Session.linkSubagent method that stores only the child session ID on the running tool part, before the child gets any work (new or continued children).
- No new events, schema, or client changes; normal success/failure still replaces the metadata as before.
How did you verify your code works?
- Added a test in
tool-subagent.test.ts checking the parent's stored tool part already has the child session ID when the child's prompt is admitted; it fails without the fix.
tool-subagent, session-runner, and session-execution tests pass.
bun run check passes.
Screenshots / recordings
BEFORE
Screen.Recording.2026-09-30.at.15.05.08.mov
AFTER
Screen.Recording.2026-10-04.at.21.04.51.mov
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks for your contribution!
This PR doesn't have a linked issue. All PRs must reference an existing issue.
Please:
- Open an issue describing the bug/feature (if one doesn't exist)
- Add
Fixes #<number> or Closes #<number> to this PR description
See CONTRIBUTING.md for details.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The following comment was made by an LLM, it may be inaccurate:
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.