Skip to content

Fix stuck diff review, model-picker focus, retry loop, and missing /help - #124

Merged
github-actions[bot] merged 2 commits into
mainfrom
fix/audit-p0-p1-findings
Aug 2, 2026
Merged

github-actions[bot] merged 2 commits into
mainfrom
fix/audit-p0-p1-findings

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Summary

Fixes six findings (one P0, three P1, two P2/P3) from a hands-on beta-readiness audit of the Forge TUI. Each was reproduced live, root-caused in source, fixed, and verified with a new regression test plus a full test-suite run.

  • P0 — Diff review panel could get permanently stuck. Any filesystem event marked the review "stale" before the async git-status refresh it triggered had actually landed, so the panel's own "press r to Refresh" recovery could never catch up — it looked unclosable. Staleness is now only flagged once the changed-path set is confirmed to differ from what's under review. Also accepts uppercase R as a refresh alias (crates/forge-tui/src/{app/watch.rs,app/commands.rs,git_status.rs,app/render.rs}).

  • P1 — /model picker made it impossible to tell which column had focus. Providers/Models/Effort always bold-highlighted their cursor row and "current" tag regardless of which column actually had keyboard focus. Tab/BackTab always cycled focus correctly — only the highlighting lied about it. Now only the truly focused column highlights (crates/forge-tui/src/overlays.rs).

  • P1 — Denying an approval could burn up to 128 model steps. A single denied tool call let the model keep autonomously searching for a workaround for up to max_turns (128 by default) before yielding control back. Two consecutive denials within a turn now stop it outright with a clear message (crates/forge-core/src/lib.rs, crates/forge-core/src/subagent.rs).

  • P2 — Ctrl+U (standard "clear line") had no binding in the composer (crates/forge-tui/src/app/input.rs).

  • P2 — /help returned "unknown command" even though the help overlay was reachable via ? on an empty composer; wired it up as a documented alias (crates/forge-tui/src/commands.rs, crates/forge-tui/src/app/commands.rs).

  • P3 — Contradictory denial wording. A denied (never-executed) call rendered as "{tool} exited with code unknown", contradicting the model's own "was not run" message right next to it. Now reads "was not run (denied or blocked)" (crates/forge-core/src/completion.rs).

Not included

Two visual findings (a light-theme rendering artifact and a residual highlight-bleed edge case) were investigated but not fixed — root-caused to the terminal-output rendering layer rather than Forge's own style/buffer computation (verified via direct buffer inspection and passing unit tests), which needs deeper escape-sequence-level debugging out of scope for this PR.

Test plan

  • cargo test -p forge-tui --lib — 681 passed
  • cargo test -p forge-core --lib — 130 passed
  • cargo build --release --locked --package forge-cli — clean, 0 warnings
  • Each fix has a dedicated regression test covering the specific failure mode
  • Manually reproduced the original bugs live in a debug build before fixing, and re-verified each fix live after

Fixes for P0/P1 findings from a beta-readiness audit:

- Diff review panel could get permanently stuck: any filesystem event
  marked the review stale before the async git-status refresh it
  triggered had landed, so the "press r to Refresh" recovery could
  never catch up and the panel felt unclosable. Staleness is now only
  flagged once the changed-path set is confirmed to differ; also
  accept uppercase R as a refresh alias.

- /model picker made it impossible to tell which column (Providers/
  Models/Effort) had keyboard focus: all three always bold-highlighted
  their cursor row and "current" tag regardless of actual focus.
  Tab/BackTab already cycled focus correctly — only the highlighting
  was wrong. Now only the focused column highlights.

- Denying a tool approval let the model keep autonomously retrying for
  up to max_turns (128) steps before yielding control back. Two
  consecutive denials within a turn now stop it outright.

- Ctrl+U (standard "clear line") had no binding in the composer.

- /help returned "unknown command" even though the help overlay was
  reachable via `?` on an empty composer; wired it up as an alias.

- A denied (never-executed) tool call rendered as "{tool} exited with
  code unknown", contradicting the model's own "was not run" message
  shown next to it. Now reads "was not run (denied or blocked)".

Each fix ships with a regression test. Full workspace test suite and
a release build both pass clean.
@github-actions
github-actions Bot enabled auto-merge (squash) August 2, 2026 03:56
@github-actions
github-actions Bot merged commit 7e5a169 into main Aug 2, 2026
6 checks passed
mohitranka added a commit that referenced this pull request Aug 21, 2026
…elp (#124)

* Fix stuck diff review, model-picker focus, retry loop, and missing /help

Fixes for P0/P1 findings from a beta-readiness audit:

- Diff review panel could get permanently stuck: any filesystem event
  marked the review stale before the async git-status refresh it
  triggered had landed, so the "press r to Refresh" recovery could
  never catch up and the panel felt unclosable. Staleness is now only
  flagged once the changed-path set is confirmed to differ; also
  accept uppercase R as a refresh alias.

- /model picker made it impossible to tell which column (Providers/
  Models/Effort) had keyboard focus: all three always bold-highlighted
  their cursor row and "current" tag regardless of actual focus.
  Tab/BackTab already cycled focus correctly — only the highlighting
  was wrong. Now only the focused column highlights.

- Denying a tool approval let the model keep autonomously retrying for
  up to max_turns (128) steps before yielding control back. Two
  consecutive denials within a turn now stop it outright.

- Ctrl+U (standard "clear line") had no binding in the composer.

- /help returned "unknown command" even though the help overlay was
  reachable via `?` on an empty composer; wired it up as an alias.

- A denied (never-executed) tool call rendered as "{tool} exited with
  code unknown", contradicting the model's own "was not run" message
  shown next to it. Now reads "was not run (denied or blocked)".

Each fix ships with a regression test. Full workspace test suite and
a release build both pass clean.

* fmt: apply cargo fmt to new test
mohitranka added a commit that referenced this pull request Sep 11, 2026
…elp (#124)

* Fix stuck diff review, model-picker focus, retry loop, and missing /help

Fixes for P0/P1 findings from a beta-readiness audit:

- Diff review panel could get permanently stuck: any filesystem event
  marked the review stale before the async git-status refresh it
  triggered had landed, so the "press r to Refresh" recovery could
  never catch up and the panel felt unclosable. Staleness is now only
  flagged once the changed-path set is confirmed to differ; also
  accept uppercase R as a refresh alias.

- /model picker made it impossible to tell which column (Providers/
  Models/Effort) had keyboard focus: all three always bold-highlighted
  their cursor row and "current" tag regardless of actual focus.
  Tab/BackTab already cycled focus correctly — only the highlighting
  was wrong. Now only the focused column highlights.

- Denying a tool approval let the model keep autonomously retrying for
  up to max_turns (128) steps before yielding control back. Two
  consecutive denials within a turn now stop it outright.

- Ctrl+U (standard "clear line") had no binding in the composer.

- /help returned "unknown command" even though the help overlay was
  reachable via `?` on an empty composer; wired it up as an alias.

- A denied (never-executed) tool call rendered as "{tool} exited with
  code unknown", contradicting the model's own "was not run" message
  shown next to it. Now reads "was not run (denied or blocked)".

Each fix ships with a regression test. Full workspace test suite and
a release build both pass clean.

* fmt: apply cargo fmt to new test
mohitranka added a commit that referenced this pull request Sep 11, 2026
…elp (#124)

* Fix stuck diff review, model-picker focus, retry loop, and missing /help

Fixes for P0/P1 findings from a beta-readiness audit:

- Diff review panel could get permanently stuck: any filesystem event
  marked the review stale before the async git-status refresh it
  triggered had landed, so the "press r to Refresh" recovery could
  never catch up and the panel felt unclosable. Staleness is now only
  flagged once the changed-path set is confirmed to differ; also
  accept uppercase R as a refresh alias.

- /model picker made it impossible to tell which column (Providers/
  Models/Effort) had keyboard focus: all three always bold-highlighted
  their cursor row and "current" tag regardless of actual focus.
  Tab/BackTab already cycled focus correctly — only the highlighting
  was wrong. Now only the focused column highlights.

- Denying a tool approval let the model keep autonomously retrying for
  up to max_turns (128) steps before yielding control back. Two
  consecutive denials within a turn now stop it outright.

- Ctrl+U (standard "clear line") had no binding in the composer.

- /help returned "unknown command" even though the help overlay was
  reachable via `?` on an empty composer; wired it up as an alias.

- A denied (never-executed) tool call rendered as "{tool} exited with
  code unknown", contradicting the model's own "was not run" message
  shown next to it. Now reads "was not run (denied or blocked)".

Each fix ships with a regression test. Full workspace test suite and
a release build both pass clean.

* fmt: apply cargo fmt to new test
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