Skip to content

fix(tui): stop blocking the event loop on approved commands - #362

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/approval-hangs-pending
Aug 16, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
fix/approval-hangs-pending

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Summary

  • Approving a HITL command no longer waits inside drain_pending_hitl, which left the card pending and froze input.
  • Spawn the approved tool off the event loop, poll it from run_loop, and abort leftover work on cancel or drop.
  • Keep the follow-up model turn queued until the command actually finishes.

Why

Enter queued the decision, but the event loop still blocked on the command. The approval card stayed pending and the TUI hung until the process finished.

Test plan

  • cargo test --package forge-tui --lib -- approval
  • cargo test --package forge-tui --lib -- approving_a_hitl_gated_tool_resumes_the_turn_instead_of_stalling_forever -- --exact
  • cargo clippy --package forge-tui --all-targets --locked -- -D warnings
  • Approve a slow shell command in the TUI and confirm the card clears immediately

Approving a HITL command was still waiting inside drain_pending_hitl,
so the card stayed pending and the TUI stopped taking input. Spawn the
approved tool off the event loop, poll it, and abort leftover work on
cancel or drop.
@github-actions
github-actions Bot enabled auto-merge (squash) August 16, 2026 14:58
@github-actions
github-actions Bot merged commit 51ad7ea into main Aug 16, 2026
7 checks passed
mohitranka added a commit that referenced this pull request Aug 21, 2026
Approving a HITL command was still waiting inside drain_pending_hitl,
so the card stayed pending and the TUI stopped taking input. Spawn the
approved tool off the event loop, poll it, and abort leftover work on
cancel or drop.
mohitranka added a commit that referenced this pull request Sep 11, 2026
Approving a HITL command was still waiting inside drain_pending_hitl,
so the card stayed pending and the TUI stopped taking input. Spawn the
approved tool off the event loop, poll it, and abort leftover work on
cancel or drop.
mohitranka added a commit that referenced this pull request Sep 11, 2026
Approving a HITL command was still waiting inside drain_pending_hitl,
so the card stayed pending and the TUI stopped taking input. Spawn the
approved tool off the event loop, poll it, and abort leftover work on
cancel or drop.
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