Skip to content

FEAT: add balanced, none and required confirmation modes - #101

Merged
merefield merged 8 commits into
mainfrom
feat/confirmation-policy
Nov 7, 2026
Merged

merefield merged 8 commits into
mainfrom
feat/confirmation-policy

Conversation

@merefield

@merefield merefield commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

One-time approvals and other narrow actions currently inherit extra review steps intended for broader changes. This PR makes the default policy balanced and exposes one explicit mode option in both terminal and web interfaces.

Setting Behaviour
Omitted Balanced default: confirm higher-impact actions.
--confirmation none Skip extra confirmations, except quota-reset redemption.
--confirmation require Confirm every substantive action; navigation and viewing stay immediate.

--confirmation balanced explicitly selects the default. The previous --no-confirm option is removed; replace it with --confirmation none. No compatibility alias is retained.

Resulting behaviour

  • Balanced: Approve Once, decline/reject, ordinary replies and queue edits, Close All, and reversible session settings apply on explicit selection. Broader session/persistent permission grants, directory and permission changes, quota-profile application, queue deletion, scheduled work and broad/external benchmark launches retain review. Terminal schedule forms retain their explicit Confirm Schedule / Save Changes action.
  • None: preserves the former opt-out behaviour. Each action still needs an explicit selection, with the same authorization, freshness and one-use capability checks. Nothing automatically approves an arriving request.
  • Require: adds review to ordinary terminal replies, active-turn steer/queue/interrupt actions, queued-message edits, profile skips and trigger deletion as well as the existing guarded workflows. Reversible model/reasoning/speed/name changes also require review. Local display preferences, navigation and read-only views stay immediate.
  • Quota-reset redemption always requires confirmation, regardless of mode.

Implementation

  • One launch-scoped policy classifies actions by their scope. CLI values are validated before launching either interface; the selected mode is projected to the browser without enabling writes or persisting preferences.
  • Promote the actual advertised Approve Once choice to the first position. Preserve the remaining offered choices and exact wire decisions; do not invent a one-time or reusable grant.
  • Strict terminal reviews show the actual action destination, including child threads, and every non-secret answer, support C/click to confirm and Esc/click to cancel, and expire after 30 seconds. Confirmation re-enters the normal action path and binds the exact payload, target and live capability. Changed requests, drafts or targets cannot reuse a previous review; secret answers remain masked and drafts survive cancellation.
  • Immediate approval buttons reserve only the width they use. Guarded buttons keep stable confirmation widths. Translated strict-review controls wrap with shared render/hit geometry, reserving their rows below the scrollable draft.
  • Browser actions retain server-side prepare/commit protection in every mode. Strict trigger deletion has an expiring, cancellable review.
  • Armed Run Scope controls show confirmation in full, compact and narrow layouts, with turns for built-in suites and remote sessions for DigBench. Profile Skip retains the actual clicked session even from a non-selected partial row.
  • Share benchmark arming, client initialization and priority update dispatch rather than duplicating the new policy branches.

Validation

  • Linux CI verifies all seven README TUI screenshots. Refresh the approval image and its manifest hashes for the compact immediate-action buttons; the other six scenes are unchanged.

  • Full Go race/coverage suite passes; exhaustive terminal presentation checks pass separately for all 17 locales.

  • 125 browser tests pass with installed Chrome, including real-server simulated approvals, independent profile reviews, all three modes, one-time versus broader grants, replies and trigger deletion.

  • Frontend type/format checks, production build, generated browser contract, Go vet, Windows application build and Windows terminal-test compilation pass.

  • Regression coverage includes stale capabilities, changed payloads/targets, expiry/cancellation, repeated keys, secret-first and secret-last answers, child destinations, selected/non-selected partial-row Skip, translated wrapping, long drafts, mouse hit geometry and compact approval buttons.

  • All four production duplication scans pass without raising the baseline. The normalised 50-token scan improves from 145 to 142 clone pairs, 1,505 to 1,467 duplicated lines, and 10,928 to 10,660 duplicated tokens. Other production scans are unchanged.

These checks use fake Codex clients and daemon fixtures; no live model work or managed-policy approval was launched for validation.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical confirmation defects allow quota-consuming launches without a visible prompt and block strict-action confirmation in narrow terminals.

5 open issues
What changed in this PR

Adds a launch-scoped confirmation policy across terminal and browser controls, making narrow actions immediate by default while retaining review for higher-impact changes.

Changes:

  • Replaces --no-confirm with --confirmation balanced|none|require, while always confirming quota-reset redemption.
  • Adds strict terminal action reviews and browser policy handling, and prioritizes advertised Approve Once choices.
  • Updates documentation, browser assets, contracts and regression coverage.
File Description
web/​tests/​browser.spec.ts Tests browser confirmation modes and action scope.
web/​src/​SessionCommands.svelte Applies policy to session-command review controls.
web/​src/​SessionActions.svelte Adds scope-based reviews and trigger-deletion confirmation.
web/​src/​contracts.generated.ts Exposes confirmation mode in the browser contract.
web/​src/​confirmation.ts Defines browser confirmation presentation policy.
README.md Documents modes, migration and interaction changes.
main.go Validates and passes launch policy to both interfaces.
main_web_test.go Tests mode propagation, isolation and invalid flags.
main_test.go Updates terminal launch test signatures.
main_logging_test.go Updates logging test launch signatures.
internal/​web/​state.go Publishes confirmation mode with a balanced default.
internal/​web/​server.go Accepts policy options and reports active mode.
internal/​web/​dist/​index.html References the updated browser bundle.
internal/​web/​control_commands_test.go Preserves server-ticket checks in none mode.
internal/​ui/​quota_step_down.go Applies policy to quota-profile confirmation.
internal/​ui/​quota_reset_test.go Verifies reset confirmation remains mandatory.
internal/​ui/​monitor.go Renders strict action reviews.
internal/​ui/​monitor_schedule_panel.go Reviews trigger deletion and applies Send now policy.
internal/​ui/​monitor_read.go Avoids read acknowledgments during action reviews.
internal/​ui/​monitor_queue.go Adds strict queue-edit review and deletion policy.
internal/​ui/​monitor_prompt.go Reviews replies and active-turn actions.
internal/​ui/​monitor_profile.go Adds strict profile-skip review.
internal/​ui/​monitor_history_test.go Selects strict mode for approval-history tests.
internal/​ui/​monitor_filter_test.go Retains guarded Close All test coverage.
internal/​ui/​monitor_commands.go Makes command footer labels policy-aware.
internal/​ui/​monitor_commands_test.go Migrates command tests to the new modes.
internal/​ui/​monitor_commands_interaction_test.go Updates picker and repeated-key policy tests.
internal/​ui/​monitor_close_all.go Makes Close All immediate outside strict mode.
internal/​ui/​monitor_close_all_test.go Explicitly tests strict Close All behavior.
internal/​ui/​monitor_approval.go Applies approval-scope policy and button sizing.
internal/​ui/​monitor_approval_test.go Updates approval interaction expectations.
internal/​ui/​model.go Prioritizes reviews and applies benchmark launch policy.
internal/​ui/​confirmations.go Provides the launch-scoped mode setter.
internal/​ui/​confirmations_test.go Migrates opt-out regression tests.
internal/​ui/​confirmation_modes_test.go Covers modes, review binding, masking and geometry.
internal/​ui/​benchmark.go Shares benchmark confirmation arming logic.
internal/​ui/​action_review.go Implements expiring, cancellable strict action reviews.
internal/​confirmation/​policy.go Defines modes and action-scope classification.
internal/​confirmation/​policy_test.go Tests policy decisions and mode parsing.
internal/​codex/​approval_options.go Moves advertised Approve Once choices first.
internal/​codex/​approval_options_test.go Tests approval-choice ordering.

Review effort: Balanced

Comment thread internal/ui/action_review.go Resolved
Comment thread internal/ui/model.go Resolved
Comment thread internal/ui/action_review.go Resolved
Comment thread internal/ui/monitor_profile.go Resolved
Comment thread internal/ui/monitor_prompt.go Resolved
@merefield
merefield merged commit 7bfaf36 into main Nov 7, 2026
8 checks passed
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.

2 participants