Skip to content

fix(tui): show background subagent completion - #36530

Merged
kitlangton merged 4 commits into
v2from
completion-ui-study
Jul 12, 2026
Merged

kitlangton merged 4 commits into
v2from
completion-ui-study

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What

Background subagents now leave a concise terminal-state notice in the parent V2 transcript. Success, failure, and cancellation are visible without relying on a later model response, while the full subagent result remains model-only.

How

  • packages/core/src/tool/subagent.ts attaches the existing synthetic description field and metadata for the child ID, agent, and terminal state.
  • packages/tui/src/routes/session/index.tsx renders a one-line, theme-aware completion notice from that metadata.
  • packages/core/test/tool-subagent.test.ts verifies the metadata survives durable synthetic-input admission.

Scope

This does not change public schemas, Protocol or Server APIs, generated clients, database schemas, or subagent execution semantics. It uses the existing synthetic-message description and open metadata fields.

Testing

  • cd packages/core && bun run test test/tool-subagent.test.ts
  • cd packages/core && bun typecheck
  • cd packages/tui && bun run test test/cli/tui/session-rows.test.ts test/cli/tui/inline-tool-wrap-snapshot.test.tsx
  • cd packages/tui && bun typecheck
  • pre-push full monorepo typecheck: 31/31 tasks passed
  • deterministic OpenCode Drive reproduction against the V2 TUI

Demo

The deterministic recording launches the V2 TUI against the simulated OpenCode backend, starts a background Researcher subagent, and shows its completion returning to the parent transcript.

V2 TUI background subagent completion

Watch the recording

Flow

sequenceDiagram
  participant Child as Subagent job
  participant Core as Core session
  participant Inbox as Durable parent inbox
  participant TUI as V2 TUI
  Child->>Core: completed / error / cancelled
  Core->>Inbox: admit synthetic completion
  Inbox-->>TUI: session.input.admitted
  TUI->>TUI: render agent, status, and task
  Inbox->>Core: promote at safe boundary
  Core->>Core: include full result in model history
Loading

Closes #35063

@kitlangton
kitlangton merged commit 5414697 into v2 Jul 12, 2026
17 checks passed
@kitlangton
kitlangton deleted the completion-ui-study branch July 12, 2026 15:43
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
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