Skip to content

fix(tui): archive completed background shell output#4724

Open
qinlinwang wants to merge 1 commit into
Hmbown:mainfrom
qinlinwang:fix/archive-background-shell-output
Open

fix(tui): archive completed background shell output#4724
qinlinwang wants to merge 1 commit into
Hmbown:mainfrom
qinlinwang:fix/archive-background-shell-output

Conversation

@qinlinwang

Copy link
Copy Markdown
Contributor

Summary:

  • Archive a background Shell job's final visible stdout/stderr tail into its
    originating ExecCell when the job reaches a terminal state.
  • Clear live_output and build the existing output summary on finalization.
  • Freeze the displayed duration at the terminal snapshot.

Why:

Completed jobs remained in ShellManager for up to one hour. Their snapshots
compute elapsed_ms from started_at, so an ExecCell with no final output kept
accepting later snapshots and its displayed time continued to grow after the
process had already ended.

Scope:

  • TUI synchronization of existing background Shell jobs only.

Testing

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features
  • cargo test --workspace --all-features

Checklist

  • Updated docs or comments as needed
  • Added or updated tests where relevant
  • Verified TUI behavior manually if UI changes
  • Harvested/co-authored credit uses a GitHub numeric noreply address

When a background shell reaches a terminal state, persist the final
visible stdout/stderr tail on its originating ExecCell instead of leaving
it only in live_output.

This keeps completed background shell cards stable for transcript history
and output summaries while preserving live updates for running jobs.

Finalizing the ExecCell also freezes the displayed duration, preventing
completed jobs from receiving later elapsed-time snapshots until cleanup.

Add coverage for finalizing a completed background shell card.
@qinlinwang
qinlinwang requested a review from Hmbown as a code owner July 23, 2026 13:34
@github-actions

Copy link
Copy Markdown
Contributor

Thanks @qinlinwang for taking the time to contribute.

This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered.

Please read CONTRIBUTING.md for the expected contribution shape. A maintainer can grant recurring PR access by commenting /lgtm on a pull request.

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