Skip to content

fix(tui): isolate background subagent session events - #130

Merged
kingsword09 merged 1 commit into
mainfrom
fix/issue-129
Sep 6, 2026
Merged

fix(tui): isolate background subagent session events#130
kingsword09 merged 1 commit into
mainfrom
fix/issue-129

Conversation

@kingsword09

Copy link
Copy Markdown
Owner

Background subagents can stream tool cards and final-answer text into the foreground because the runtime broadcasts raw child-session events alongside parent-session tool mirrors.

Preserve session ownership during event normalization and reject events from other sessions at both TUI event entry points. Treat inputSource: "subagent" turns as task-scoped without starting a parent result handoff, so foreground input handling stays independent of child execution. Parent TaskOutput results and background completion notifications remain visible.

Regression coverage injects two child sessions' text, Bash activity, protocol parts, and nested-task notifications, then checks both the normal and expanded foreground transcript while preserving a parent TaskOutput result.

Validation:

  • bun test --dots: 612 passed, 0 failed
  • bun run typecheck
  • bun run build
  • Locked runtime sync and bun scripts/check-runtime.ts
  • bun run check:tui
  • bun scripts/check-package.ts
  • git diff --check

Fixes #129

@kingsword09
kingsword09 merged commit 9f4edac into main Sep 6, 2026
1 check passed
@kingsword09
kingsword09 deleted the fix/issue-129 branch September 6, 2026 14:00
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.

Background subagent events leak into the foreground transcript despite the TaskOutput rendering fix

1 participant