Repository navigation
hitl: spectrum remember (allow pattern) and reject-with-feedback - #195
Merged
github-actions[bot] merged 1 commit intoAug 3, 2026
Merged
Conversation
Expand the approval card's decision set from (allow once / remember exact / deny) to (allow once / remember exact / allow pattern going forward / deny / deny with feedback): - "Allow pattern going forward" generalizes the call (suggest_pattern in forge-governance) into a command-prefix/path-glob/host pattern, shows the literal text for confirmation before committing (a new ConfirmPattern card stage), then persists it to the personal permissions.toml and adds it to the session's in-memory pattern-allow list so it takes effect immediately without a restart. Unlike "remember exact", this is offered for Shell-mode calls too, since a command prefix is exactly what makes sense there (every invocation differs in its trailing args). - "Deny with feedback" collects a short note (a new DenyFeedback card stage) that reaches the agent as tool-result content alongside the denial (AgentSession::resolve_hitl_with_feedback in forge-core), so it doesn't have to be re-explained next turn. Modeled on opencode's CorrectedError. Mouse hit-regions for the card's buttons are now found by searching the actual rendered lines instead of hand-maintained row offsets, so a future layout change can't leave the two out of sync. Phase 3 of the HITL/permission-model redesign in docs/hitl-permission-model-research.md.
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
Expand the approval card's decision set from (allow once / remember exact / deny) to (allow once / remember exact / allow pattern going forward / deny / deny with feedback): - "Allow pattern going forward" generalizes the call (suggest_pattern in forge-governance) into a command-prefix/path-glob/host pattern, shows the literal text for confirmation before committing (a new ConfirmPattern card stage), then persists it to the personal permissions.toml and adds it to the session's in-memory pattern-allow list so it takes effect immediately without a restart. Unlike "remember exact", this is offered for Shell-mode calls too, since a command prefix is exactly what makes sense there (every invocation differs in its trailing args). - "Deny with feedback" collects a short note (a new DenyFeedback card stage) that reaches the agent as tool-result content alongside the denial (AgentSession::resolve_hitl_with_feedback in forge-core), so it doesn't have to be re-explained next turn. Modeled on opencode's CorrectedError. Mouse hit-regions for the card's buttons are now found by searching the actual rendered lines instead of hand-maintained row offsets, so a future layout change can't leave the two out of sync. Phase 3 of the HITL/permission-model redesign in docs/hitl-permission-model-research.md.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
Expand the approval card's decision set from (allow once / remember exact / deny) to (allow once / remember exact / allow pattern going forward / deny / deny with feedback): - "Allow pattern going forward" generalizes the call (suggest_pattern in forge-governance) into a command-prefix/path-glob/host pattern, shows the literal text for confirmation before committing (a new ConfirmPattern card stage), then persists it to the personal permissions.toml and adds it to the session's in-memory pattern-allow list so it takes effect immediately without a restart. Unlike "remember exact", this is offered for Shell-mode calls too, since a command prefix is exactly what makes sense there (every invocation differs in its trailing args). - "Deny with feedback" collects a short note (a new DenyFeedback card stage) that reaches the agent as tool-result content alongside the denial (AgentSession::resolve_hitl_with_feedback in forge-core), so it doesn't have to be re-explained next turn. Modeled on opencode's CorrectedError. Mouse hit-regions for the card's buttons are now found by searching the actual rendered lines instead of hand-maintained row offsets, so a future layout change can't leave the two out of sync. Phase 3 of the HITL/permission-model redesign in docs/hitl-permission-model-research.md.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
Expand the approval card's decision set from (allow once / remember exact / deny) to (allow once / remember exact / allow pattern going forward / deny / deny with feedback): - "Allow pattern going forward" generalizes the call (suggest_pattern in forge-governance) into a command-prefix/path-glob/host pattern, shows the literal text for confirmation before committing (a new ConfirmPattern card stage), then persists it to the personal permissions.toml and adds it to the session's in-memory pattern-allow list so it takes effect immediately without a restart. Unlike "remember exact", this is offered for Shell-mode calls too, since a command prefix is exactly what makes sense there (every invocation differs in its trailing args). - "Deny with feedback" collects a short note (a new DenyFeedback card stage) that reaches the agent as tool-result content alongside the denial (AgentSession::resolve_hitl_with_feedback in forge-core), so it doesn't have to be re-explained next turn. Modeled on opencode's CorrectedError. Mouse hit-regions for the card's buttons are now found by searching the actual rendered lines instead of hand-maintained row offsets, so a future layout change can't leave the two out of sync. Phase 3 of the HITL/permission-model redesign in docs/hitl-permission-model-research.md.
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
docs/hitl-permission-model-research.md).p): generalizes the call into a pattern via a newforge_governance::suggest_pattern(command-prefix for shell tools, path-glob for file tools, host for fetch tools), shows the literal pattern text in a confirmation sub-stage (ConfirmPattern) before committing — per opencode's "Allow always" stage — then persists it to the personalpermissions.tomland adds it to the session's in-memory pattern-allow list so it applies immediately without a restart. Offered for Shell-mode calls too (unlike "remember exact", which only makes sense for Direct-mode calls with stable arguments).f): a newDenyFeedbackcard stage collects a short note that reaches the agent as tool-result content alongside the denial (AgentSession::resolve_hitl_with_feedback), modeled on opencode'sCorrectedError— no more re-explaining the same thing next turn.approval_card_action_row) instead of hand-maintained row-offset arithmetic, so a future content/layout change can't silently desync clicks from what's on screen.Test plan
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo test --workspace --all-targets --locked(0 failures across all 18 crates; 691 in forge-tui, up from 684; 133 in forge-core, up from 131)suggest_patterncorrectness + "always matches its own call" property (forge-governance),resolve_hitl_with_feedback(forge-core), and the full card flow — pattern eligibility on shell calls, confirm/cancel, session auto-approval of matching-but-different calls, deny-with-feedback confirm/cancel/blank (forge-tui).allow_pattern_confirm_approves_and_auto_allows_matching_calls_this_session) exercises the realappend_user_allow_ruledisk write; it redirectsHOME/XDG_CONFIG_HOMEto a tempdir first so it never touches the developer's real config directory.