Skip to content

Stream shell output to the TUI tail - #18

Merged
CalvinSturm merged 1 commit into
mainfrom
feat/live-shell-output-tail
Jul 1, 2026
Merged

Stream shell output to the TUI tail#18
CalvinSturm merged 1 commit into
mainfrom
feat/live-shell-output-tail

Conversation

@CalvinSturm

Copy link
Copy Markdown
Owner

Summary

Streams host shell stdout/stderr live into the existing TUI/log tail while preserving the final shell result envelope.

Long-running shell commands now show progress during execution instead of appearing inactive until completion.

What changed

  • Added live ShellOutputChunk events for host shell stdout/stderr

  • Threaded optional shell streaming through shell execution only

  • Rendered live shell chunks in the existing TUI/log tail

  • Displays stdout as out> and stderr as err>

  • Preserved the final shell result envelope:

    • stdout
    • stderr
    • truncation flags
    • timed_out
    • timeout_ms
    • status
  • Kept CLI projected JSON unchanged

  • Kept JSONL/tail event output bounded

Memory and throttling behavior

  • Live shell forwarding uses a bounded Tokio channel of 128 chunks
  • Producers use best-effort try_send
  • Noisy live output can drop progress chunks without affecting the final captured stdout/stderr
  • Agent-side live output is capped at 64 KiB per command
  • When the live cap is reached, a notice is emitted:
    [live output truncated; see final result]
  • TUI log growth remains bounded by the existing max_log_lines

Why

PR #15 made shell execution bounded.
PR #16 preserved useful head/tail output after completion.
PR #17 added a default timeout policy.

This PR closes the remaining shell UX gap: the user can now see command progress while a long shell command is still running.

Validation

  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • focused live stream/TUI tests
  • cargo test --lib target::
  • cargo test --lib tools::
  • cargo test --test tool_call_accuracy_ci
  • cargo test --lib repro
  • cargo test --test artifact_golden
  • python scripts/ci_release_readiness.py
  • cargo test

All validation passed locally.

Follow-ups

  • Add deliberate CLI live shell display through a projected-event/display path
  • Add Docker live streaming after Docker timeout semantics are addressed
  • Robust process-tree cleanup
  • Lightweight in-run todo/update_plan tool

@CalvinSturm
CalvinSturm merged commit a743e58 into main Jul 1, 2026
1 check passed
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