feat(run): make bypass permissions selectable in a lane pane's shift+tab cycle
`claude` only offers bypass in its shift+tab permission cycle when started with `--allow-dangerously-skip-permissions`, which the pane argv never passed. A dashboard-started run was therefore stuck cycling plan/auto/manual/ accept-edits, while the same session attached from a real terminal could reach bypass. The flag makes bypass SELECTABLE, not enabled — `claude --help`: "Enable bypassing all permission checks as an option, without it being enabled by default." The starting mode is still whatever `--permission-mode` says (`acceptEdits` by default) and `--dangerously-skip-permissions`, which would actually turn it on, is still never passed. Entering bypass remains an explicit human shift+tab in the pane, or an explicit `permissionMode: "bypassPermissions"` on POST /api/run.
This commit is contained in:
@@ -62,6 +62,13 @@ function makeErr(code, message) {
|
||||
function buildArgv({ model, permissionMode, effort, resumeSessionId, initialPrompt }) {
|
||||
const argv = ["claude"];
|
||||
argv.push("--permission-mode", permissionMode || "acceptEdits");
|
||||
// Puts "bypass permissions" INTO the pane's shift+tab cycle without turning
|
||||
// it on: `claude --help` — "Enable bypassing all permission checks as an
|
||||
// option, without it being enabled by default." Without it the cycle is only
|
||||
// plan/auto/manual/acceptEdits, so a run started in any non-bypass mode could
|
||||
// never reach bypass from inside the pane, while a real terminal could.
|
||||
// The starting mode is still whatever --permission-mode says above.
|
||||
argv.push("--allow-dangerously-skip-permissions");
|
||||
if (model) argv.push("--model", model);
|
||||
if (effort && EFFORT_LEVELS.has(effort)) argv.push("--effort", effort);
|
||||
if (resumeSessionId) argv.push("--resume", resumeSessionId);
|
||||
|
||||
Reference in New Issue
Block a user