Repository navigation
Fix HITL turn stall, composer escape traps, and unvalidated /model ids - #123
Merged
github-actions[bot] merged 2 commits intoAug 2, 2026
Merged
Conversation
Four separate P0/P1 usability-audit findings, all reproduced live against the built binary and covered by new regression tests: - Approving (or auto-approving/denying) a tool call that paused for HITL approval executed the tool but never re-armed the turn loop, so the follow-up model call silently never ran. The header kept reading "Working" forever with nothing actually in flight, recoverable only by killing the whole process. `resolve_hitl_overlay`/`drain_auto_hitl` now re-arm `pending_turn_continue` the same way `dequeue_and_send_next` does. - The bare `/` command palette had no way to cancel or edit: Esc silently moved focus off the composer without clearing the pending "/" text, leaving the dropdown rendered but orphaned (nothing routed Backspace/Enter/Tab back to it). Esc now closes an open slash palette first, and also requests a graceful turn cancellation when the composer is busy, mirroring Ctrl+C's existing first-press behavior. - `/model <name>` applied any string whose prefix matched a connected provider as the active model, with no check that the model itself existed — e.g. `/model connect` silently became the active selection `xai/connect`. Now validated against the provider's live catalog when one is available. - `?` on an empty composer typed a literal character instead of opening Help, contradicting Help's own advertised shortcut. Now opens Help when the composer is empty; typing `?` mid-message is unaffected.
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
#123) * Fix HITL turn stall, escape traps, and unvalidated /model ids Four separate P0/P1 usability-audit findings, all reproduced live against the built binary and covered by new regression tests: - Approving (or auto-approving/denying) a tool call that paused for HITL approval executed the tool but never re-armed the turn loop, so the follow-up model call silently never ran. The header kept reading "Working" forever with nothing actually in flight, recoverable only by killing the whole process. `resolve_hitl_overlay`/`drain_auto_hitl` now re-arm `pending_turn_continue` the same way `dequeue_and_send_next` does. - The bare `/` command palette had no way to cancel or edit: Esc silently moved focus off the composer without clearing the pending "/" text, leaving the dropdown rendered but orphaned (nothing routed Backspace/Enter/Tab back to it). Esc now closes an open slash palette first, and also requests a graceful turn cancellation when the composer is busy, mirroring Ctrl+C's existing first-press behavior. - `/model <name>` applied any string whose prefix matched a connected provider as the active model, with no check that the model itself existed — e.g. `/model connect` silently became the active selection `xai/connect`. Now validated against the provider's live catalog when one is available. - `?` on an empty composer typed a literal character instead of opening Help, contradicting Help's own advertised shortcut. Now opens Help when the composer is empty; typing `?` mid-message is unaffected. * Apply cargo fmt
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
#123) * Fix HITL turn stall, escape traps, and unvalidated /model ids Four separate P0/P1 usability-audit findings, all reproduced live against the built binary and covered by new regression tests: - Approving (or auto-approving/denying) a tool call that paused for HITL approval executed the tool but never re-armed the turn loop, so the follow-up model call silently never ran. The header kept reading "Working" forever with nothing actually in flight, recoverable only by killing the whole process. `resolve_hitl_overlay`/`drain_auto_hitl` now re-arm `pending_turn_continue` the same way `dequeue_and_send_next` does. - The bare `/` command palette had no way to cancel or edit: Esc silently moved focus off the composer without clearing the pending "/" text, leaving the dropdown rendered but orphaned (nothing routed Backspace/Enter/Tab back to it). Esc now closes an open slash palette first, and also requests a graceful turn cancellation when the composer is busy, mirroring Ctrl+C's existing first-press behavior. - `/model <name>` applied any string whose prefix matched a connected provider as the active model, with no check that the model itself existed — e.g. `/model connect` silently became the active selection `xai/connect`. Now validated against the provider's live catalog when one is available. - `?` on an empty composer typed a literal character instead of opening Help, contradicting Help's own advertised shortcut. Now opens Help when the composer is empty; typing `?` mid-message is unaffected. * Apply cargo fmt
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
#123) * Fix HITL turn stall, escape traps, and unvalidated /model ids Four separate P0/P1 usability-audit findings, all reproduced live against the built binary and covered by new regression tests: - Approving (or auto-approving/denying) a tool call that paused for HITL approval executed the tool but never re-armed the turn loop, so the follow-up model call silently never ran. The header kept reading "Working" forever with nothing actually in flight, recoverable only by killing the whole process. `resolve_hitl_overlay`/`drain_auto_hitl` now re-arm `pending_turn_continue` the same way `dequeue_and_send_next` does. - The bare `/` command palette had no way to cancel or edit: Esc silently moved focus off the composer without clearing the pending "/" text, leaving the dropdown rendered but orphaned (nothing routed Backspace/Enter/Tab back to it). Esc now closes an open slash palette first, and also requests a graceful turn cancellation when the composer is busy, mirroring Ctrl+C's existing first-press behavior. - `/model <name>` applied any string whose prefix matched a connected provider as the active model, with no check that the model itself existed — e.g. `/model connect` silently became the active selection `xai/connect`. Now validated against the provider's live catalog when one is available. - `?` on an empty composer typed a literal character instead of opening Help, contradicting Help's own advertised shortcut. Now opens Help when the composer is empty; typing `?` mid-message is unaffected. * Apply cargo fmt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four P0/P1 findings from a hands-on beta-readiness audit, each reproduced live against the built binary and now covered by a regression test:
resolve_hitlonly runs the tool and transitions the session lifecycle, it doesn't drive the follow-up model call. The header kept displaying "Working" indefinitely with nothing actually in flight, uncancellable and unrecoverable short of killing the whole process.resolve_hitl_overlayanddrain_auto_hitlnow re-armpending_turn_continue, the same mechanismdequeue_and_send_nextalready uses, sorun_looprestarts the model call on its next tick./command palette has no cancel (P0). Typing/opens the command palette, butEscsilently moved focus off the composer without clearing the pending text, leaving the dropdown rendered but orphaned — nothing then routed Backspace/Enter/Tab back to it, so the only way out was running one of the 8 listed commands or force-quitting the app.Escnow closes an open slash palette first, and also requests a graceful turn cancellation when the composer is busy (mirroring Ctrl+C's existing first-press-interrupts / second-press-quits behavior, which previously had no Esc equivalent at all)./model <name>accepts nonexistent models (P0). Any string whose prefix matched a connected provider became the active model with no check that the model itself existed in that provider's catalog — e.g./model connectsilently set the active selection toxai/connect, a model that doesn't exist, and the picker's own header disagreed with its own model list as a result. Now validated against the provider's live catalog when one is available; unknown models are rejected with a clear warning instead of applied.?Help", but?typed a literal character into the composer instead of opening Help. Now opens Help specifically when the composer is empty (so typing?mid-message is unaffected).Test plan
cargo test --package forge-tui— 673 passed, 0 failed (670 pre-existing + 3 new regression tests)cargo check --workspace— zero warningsapproving_a_hitl_gated_tool_resumes_the_turn_instead_of_stalling_forever) verified to fail without theapprovals.rsfix and pass with itcargo build --release --package forge-cli: bare/+ Esc now closes cleanly,/model connectis rejected with a warning instead of corrupting state,?on empty composer opens Help, and a real shell-approval flow now reaches a truthful✓ Completed/✗ Failedinstead of hanging on "Working" forever