Skip to content

fix(tui): keep application services live during turns - #399

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/tui-runtime-isolation
Aug 18, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
fix/tui-runtime-isolation

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Summary

  • centralize the complete TUI application tick used by the idle event loop
  • run that same tick while model requests and foreground tools are in flight
  • keep file watching, background tasks, approvals, connection polling, transient chrome, input, and rendering live during foreground work
  • strengthen the regression test to require a Files-pane refresh before a slow shell tool completes

Root cause

The foreground turn loop redrew and drained keyboard input, but it replaced the top-level application loop while waiting. That left every other TUI-owned service frozen until the model or tool returned.

PTY visual validation

Tested the rebuilt binary in a 120x36 tmux PTY against a disposable repository.

  • Before: a file created during sleep 60 did not appear until the foreground turn finished.
  • After: model-phase-visible.txt appeared while the model request was still Working.
  • After: tool-phase-visible.txt appeared while sleep 60 was still running.
  • Composer text repainted during the same tool execution.
  • Ctrl+C recovered to Cancelled within the next captured frame.

Validation

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo test -p forge-tui --lib (863 passed)
  • cargo test --workspace --all-targets --locked
  • git diff --check

@github-actions
github-actions Bot enabled auto-merge (squash) August 18, 2026 23:24
@github-actions
github-actions Bot merged commit 8296f3c into main Aug 18, 2026
8 checks 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