Repository navigation
Studio: an OpenCode wake-up names its own subagent and a failed subagent ends failed (#779) - #791
Merged
Merged
Conversation
…, and a failed one ends failed (#779) The plugin reads OpenCode's inbox: a subagent's result (`session.inbox.enqueued`, `metadata.source` "subagent") delivered into a turn (`session.inbox.delivered`). It holds a wake-up until its turn's first step and sends it with the results the turn took (`reported`); a result delivered later goes on a line of its own. Shell and other jobs' results are not sent. The core reads `reported` as `TasksReported`: each child ends with its result's status (`error` failed, `cancelled` interrupted), over its status-less run end, and a wake-up names every child it took, "workers A and B returned", or "background job returned" for none. A result in a turn Daniel prompted leaves his prompt. A log from before has no `reported` and replays as before. Research: docs/studio/research/opencode-background-results.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CVqACdVnKiSXskgVojtEiA
A wake-up the hook took late no longer renames the running wake-up's turn; its children still end with their results' status. The plugin keeps only results that name their child. plugin.md says a child that reports again after later work ends again with its new status, and CONTEXT.md's Wake-up covers OpenCode's. Turn.woken_by is renamed results_of, apart from Session::woken_by. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CVqACdVnKiSXskgVojtEiA
) The outside review found that a wake-up the hook took late still set the row's "worker … returned" from the latest-event fallback. The table test now checks the row's name too; the late row went red, then green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CVqACdVnKiSXskgVojtEiA
Closed
3 tasks
Resolves #719's OpenCode context size (#787) with #779's held wake-up: a top-level turn's end goes through the recorder's send, after its held wake-up, and carries context_tokens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CVqACdVnKiSXskgVojtEiA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #779.
Summary
The OpenCode plugin now reads OpenCode's inbox, so a wake-up says whose results its turn took, and a subagent ends with the status its result reports.
Turn.results_ofis saved but left out of the pane's JSON. The saved-stateFORMATgoes 9 → 10, so the first launch replays the whole log once.wake_ups.rstest now pins Claude's.docs/studio/plugin.mdis rewritten, and the open-race sentence is gone. The research notedocs/studio/research/opencode-background-results.mdis committed and cited. The Wake-up entry indocs/studio/CONTEXT.mdnow covers OpenCode.system-map.jsondidn't need a change (system-map checkok).Tests: none removed.
wake_ups.rs'sa_wake_up_from_a_task_with_no_subagent_names_it_by_its_short_idbecame a table, with one row for one task and one for two tasks.Evidence
opencode::a_wake_up_names_the_subagents_whose_results_its_turn_took_and_each_ends_with_its_status, 8 rows. On main:errorends completed.ui/tests/opencode-plugin.test.mjs(new) loads the rendered plugin with a fake OpenCode and a fake hook. It checks the held wake-up and itsreportedlist, the laterinbox.deliveredline and the shell filter.npm run checkpasses on the branch merged with main: 1959 Rust tests, plus 835 Node tests with 834 passed, 0 failed and 1 skipped.r.send, so it goes out after its held wake-up, and it carriescontext_tokens. The.step.endedbranch sits beside the new.step.startedflush.plugin.mdkeeps both sections, and the fixture list includescontext.jsonl.Outside review
cost: 4.3 min, 234015 tokens; Gemini quota left: weekly 54% to 53%, 5h 100% to 96%Sender::WakeUp(woken_by())and overwrote the row's "worker … returned" on the running turn (core/src/studio/take.rs).Some("worker A returned")againstSome("worker B returned")), then green.Merge Danger
Door: two-way. Saved state moves to
FORMAT10, and both builds reject the other's file by its header and replay from the log. The plugin's new fields and lines are ignored by an older core.Blast Radius: OpenCode sessions only. That covers wake-up labels, the row's returned text, and subagents ending failed or interrupted. No real run has shown an
errororcancelledresult yet; those states come from OpenCode's source and tests.🤖 Generated with Claude Code
https://claude.ai/code/session_01CVqACdVnKiSXskgVojtEiA