Skip to content

fix(opencode): make dispatch wait for child tasks#147

Open
1508324011 wants to merge 3 commits intomindfold-ai:mainfrom
1508324011:fix/opencode-dispatch-sync-subagents
Open

fix(opencode): make dispatch wait for child tasks#147
1508324011 wants to merge 3 commits intomindfold-ai:mainfrom
1508324011:fix/opencode-dispatch-sync-subagents

Conversation

@1508324011
Copy link
Copy Markdown

Summary

  • switch the OpenCode dispatch instructions to synchronous child Task(...) calls instead of background TaskOutput polling
  • add regression coverage so the OpenCode template cannot quietly reintroduce run_in_background: true child phases
  • document the OpenCode platform rule that background task status is not the final completion signal for child sessions

Testing

  • pnpm --filter @mindfoldhq/trellis test -- regression.test.ts
  • pnpm --filter @mindfoldhq/trellis build

1508324011 and others added 3 commits April 4, 2026 13:06
Switch the OpenCode dispatch instructions to synchronous child Task calls so Trellis stops treating the background wrapper as the true completion signal for subagent phases.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Lock in the OpenCode dispatch behavior change so future template edits cannot quietly reintroduce background TaskOutput polling for child phases.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Document that Trellis OpenCode dispatch must wait for child Task calls to return instead of using background task status as the final completion signal.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@1508324011
Copy link
Copy Markdown
Author

Follow-up note: after more testing, I no longer think this PR should be described as a complete fix.

It still looks useful as a mitigation because it removes one error-prone dispatch pattern in the OpenCode template.

But in longer conversations, the underlying background completion semantics can still be wrong even when the prompt says to use synchronous child calls. So this PR is better framed as a patch / risk reduction step, while the root cause is likely in the lower-level TaskOutput / background_output completion mechanism (or a wrapper below Trellis).

I opened a follow-up issue to track that root problem separately.

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