Skip to content

feat(tui): resolve human-in-the-loop approvals inline in the transcript - #262

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/inline-hitl-approval
Aug 5, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/inline-hitl-approval

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Summary

Replaces the docked approval card with a transcript-native HITL flow. Pending tool calls render as full-payload inline items, and operators answer by typing verbs in the composer.

Changes

  • Inline item: ChatItem::ApprovalPending shows redacted command, cwd:, env: delta, and a yes | no | remember | always | no <note> hint line.
  • Typed grammar (input_route::parse_approval_line, active only while WaitReason::Approval):
    • yes|approve|y — approve once
    • remember — approve + session-scoped exact-invocation allow (Direct tools only)
    • always|allow — approve + persist suggested pattern (permanent)
    • no|deny|n — deny; no <note> — deny with feedback to the agent
    • First-word boundary match; noise is unrecognized, no prefix matching
  • Reject preserves text: unrecognized lines keep the operator's input for editing instead of dropping it.
  • Standing cue: contextual_hint() shows ⏸ approval · yes | no | remember | always | no <note> while waiting (scroll-surviving).
  • Clean deletion: ApprovalCardWidget, ApprovalStage, card key handling, mouse hit regions, dock-height shrink, overlay key gating all removed. ApprovalOverlayState kept (minus source/focus machinery) for identity matching and pattern auto-allow.

Tests

  • Rewrote approval tests for composer-driven resolution (set_pending_hitl + typed submit): remember expiry across sessions, env/cwd sensitivity, shell remember ineligibility, deny-with-feedback reaching the agent, pattern persistence via redirected HOME, duplicate-resolution idempotence.
  • Retargeted pointer/chrome card mouse tests to the overlay block.
  • 735 forge-tui lib tests pass; cargo fmt --check, cargo clippy --workspace --all-targets -D warnings clean.

Known pre-existing failures (unrelated, env/fixture)

  • 3 forge-config permission tests reading the developer's real permissions.toml.
  • 1 forge-connect oauth_fixture_connects fixture model-label drift (grok-3 vs grok-4.20-0309).

Closes #260

Replace the docked approval card with a transcript-native flow: the pending
tool call renders as a full-payload inline item (redacted command, cwd, env
delta, resolution hint), and operators answer it by typing in the composer.

- Add ChatItem::ApprovalPending with command/cwd/env render arm
- Parse typed verbs in the composer: yes|approve|y, remember, always|allow,
  no|deny|n, and no <note> (greedy tail feeds the agent as tool feedback)
- Unrecognized lines keep the operator's text in the input box for editing
- remember persists a session-scoped exact-invocation allow (Direct tools
  only); always persists the suggested allow pattern to the permissions file
- Delete ApprovalCardWidget, approval card key handling, mouse hit regions,
  dock-height shrink, and overlay key gating (ApprovalOverlayState retained
  for identity matching and auto-allow logic)
- Show approval verb hint in the contextual hint while waiting

Closes #260
@github-actions
github-actions Bot enabled auto-merge (squash) August 5, 2026 12:59
@github-actions
github-actions Bot merged commit aadf4fd into main Aug 5, 2026
7 checks passed
mohitranka added a commit that referenced this pull request Aug 21, 2026
…pt (#262)

Replace the docked approval card with a transcript-native flow: the pending
tool call renders as a full-payload inline item (redacted command, cwd, env
delta, resolution hint), and operators answer it by typing in the composer.

- Add ChatItem::ApprovalPending with command/cwd/env render arm
- Parse typed verbs in the composer: yes|approve|y, remember, always|allow,
  no|deny|n, and no <note> (greedy tail feeds the agent as tool feedback)
- Unrecognized lines keep the operator's text in the input box for editing
- remember persists a session-scoped exact-invocation allow (Direct tools
  only); always persists the suggested allow pattern to the permissions file
- Delete ApprovalCardWidget, approval card key handling, mouse hit regions,
  dock-height shrink, and overlay key gating (ApprovalOverlayState retained
  for identity matching and auto-allow logic)
- Show approval verb hint in the contextual hint while waiting

Closes #260
mohitranka added a commit that referenced this pull request Sep 11, 2026
…pt (#262)

Replace the docked approval card with a transcript-native flow: the pending
tool call renders as a full-payload inline item (redacted command, cwd, env
delta, resolution hint), and operators answer it by typing in the composer.

- Add ChatItem::ApprovalPending with command/cwd/env render arm
- Parse typed verbs in the composer: yes|approve|y, remember, always|allow,
  no|deny|n, and no <note> (greedy tail feeds the agent as tool feedback)
- Unrecognized lines keep the operator's text in the input box for editing
- remember persists a session-scoped exact-invocation allow (Direct tools
  only); always persists the suggested allow pattern to the permissions file
- Delete ApprovalCardWidget, approval card key handling, mouse hit regions,
  dock-height shrink, and overlay key gating (ApprovalOverlayState retained
  for identity matching and auto-allow logic)
- Show approval verb hint in the contextual hint while waiting

Closes #260
mohitranka added a commit that referenced this pull request Sep 11, 2026
…pt (#262)

Replace the docked approval card with a transcript-native flow: the pending
tool call renders as a full-payload inline item (redacted command, cwd, env
delta, resolution hint), and operators answer it by typing in the composer.

- Add ChatItem::ApprovalPending with command/cwd/env render arm
- Parse typed verbs in the composer: yes|approve|y, remember, always|allow,
  no|deny|n, and no <note> (greedy tail feeds the agent as tool feedback)
- Unrecognized lines keep the operator's text in the input box for editing
- remember persists a session-scoped exact-invocation allow (Direct tools
  only); always persists the suggested allow pattern to the permissions file
- Delete ApprovalCardWidget, approval card key handling, mouse hit regions,
  dock-height shrink, and overlay key gating (ApprovalOverlayState retained
  for identity matching and auto-allow logic)
- Show approval verb hint in the contextual hint while waiting

Closes #260
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