feat(engine,policy): human-in-the-loop approvals (issue #106)#128
Merged
Conversation
Add Policy.spec.hitl configuration and pause gated tool calls at checkpoints with approve, reject, edit, and switch decisions. Non-interactive runs exit interrupted; resume via --decision or --auto-approve. Emit approval.requested and approval.resolved trace events with actor attribution and edit diffs. Co-authored-by: Cursor <cursoragent@cursor.com>
ReviewGate [WARN]
|
Automated reviewSummarySignificant updates to add human-in-the-loop (HITL) functionality with decision-making capabilities. Findings
|
Propagate invalid decision kinds from buildEngineHitlOptions, reject --decision without --resume, and error when interrupted checkpoints lack pendingHitl. Auto-approve now emits approval trace events; document interruptOn semantics; validate interruptOn tool refs at load time. Co-authored-by: Cursor <cursoragent@cursor.com>
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
Policy.spec.hitlschema (interruptOn,toolSwitchMap, edit/switch rules,redactKeys) with validation at project load time.interruptedcheckpoint with pending HITL state, emitsapproval.requested/approval.resolvedtrace events (with actor, edit diffs), and supports approve | reject | edit | switch decisions.--auto-approve/AGENTCTL_AUTO_APPROVE,--decision(+--decision-edit-json,--decision-switch-target) onrun --resume, and TTY interactive prompt loop. Pre-approval via--approveremains supported.Closes #106
Test plan
make ci(gofmt, vet, race tests)TestHitl_*)--resume --decision approvehitl.interruptOnin a demo projectMade with Cursor