feat(permission): prompt for confirmation in manual mode - #90
Merged
Conversation
…locking manual permission mode now asks the user before executing each shell command instead of blocking outright. Shows the command and waits for y/N confirmation. auto and accept-all modes unchanged. - Add ctx.ui.confirm() prompt before shell execution in manual mode - User can approve (y) or cancel (n) each command - Update README to document new manual mode behavior - Add tests for confirm/cancel/prompt-for-all-cmds
marek2901
force-pushed
the
manual-permission-prompt
branch
from
August 15, 2026 23:53
9ee494e to
f2331f3
Compare
itayinbarr
approved these changes
Aug 22, 2026
itayinbarr
left a comment
Owner
There was a problem hiding this comment.
Approved. manual mode has been the odd one out since it landed: it blocked exactly what auto blocks and only changed the wording of the refusal, which is not what anyone reading "manual" expects. Prompting per command is the behavior the name promises.
I checked the parts that worried me before approving:
ctx.ui.confirmis on the plainExtensionContextin pi 0.83 (ui: Pick<ExtensionUIContext, "select" | "confirm" | "input" | "notify">), so thetool_callhandler really does have it. Not every session does: pi'snoOpUIContext.confirmresolvesfalse, so a headless run in manual mode refuses everything. That is the right default for a mode whose whole point is a human in the loop, and it cannot bite sub-coders becausebuildChildEnvpins children toLITTLE_CODER_PERMISSION_MODE=auto.- Confirming skips
isSafeBashentirely, including for whitelisted commands. Correct: in manual mode the user is the whitelist.write-guardis a separatetool_callhandler and still runs, so a confirmedcat > existing.pyis still caught by the guard that exists for that. - Full suite green on your branch (633 passed), typecheck clean, and the branch is not behind main.
Thanks for keeping it to ctx.ui.confirm rather than inventing an abstraction.
itayinbarr
pushed a commit
that referenced
this pull request
Aug 22, 2026
…compacted" (#109, #91) The context watchdog reported its result through the ctx captured at the turn that fired the compaction. pi invalidates the whole extension runtime on dispose(), so ctx.ui and pi.sendUserMessage() throw from that point on, and pi invokes the compaction callbacks from a floating promise: the throw became an unhandled rejection and a hard exit 1. Reproduced end to end against a live backend, with heinrichI's exact stack trace, and verified fixed on the same run. The same callback also treated every rejection as "compaction is futile, pause". "Already compacted" means someone else's compaction landed first, so the context is compacted and only our call lost the race; pausing there stranded a mid-task run at the prompt. It now resumes like a success, a cancellation is silent, and only a real failure still pauses. An outstanding-call counter stops a turn boundary mid-compaction from starting the second call that loses that race. Also fixes the write-guard regression in #107 (a device redirect butted straight up against ;, &&, ||, | or a closing paren), and merges #90 and #105. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KviAutUdC2iacq59kUcuxJ
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
In
manualpermission mode, little-coder now prompts the user before executing any shell command instead of blocking outright.Behavior
auto(default)accept-allmanualIn manual mode:
Execute this command?y) → executen) → block with "command cancelled by user"Usage
export LITTLE_CODER_PERMISSION_MODE=manual little-coderImplementation
ctx.ui.confirm()APIFiles changed
.pi/extensions/permission-gate/index.ts— add confirmation prompt for manual mode.pi/extensions/permission-gate/permission.test.ts— add tests for manual modeREADME.md— updateLITTLE_CODER_PERMISSION_MODEtable