From cf73521f2180694d37ab9f2941af3136654cd7e6 Mon Sep 17 00:00:00 2001 From: "Factory: remote-delegations" <138933559+factory-droid[bot]@users.noreply.github.com> Date: Mon, 23 Nov 2026 23:17:47 +0000 Subject: [PATCH] fix: let enter-spec-mode approve read-only commands The model sometimes checks the bytes it wrote with a read-only shell command such as `od -c hello.txt`. The permission handler cancelled it, and a cancel ends the turn as interrupted, so the nightly Examples run failed on about half of its attempts. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- examples/node/enter-spec-mode.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/node/enter-spec-mode.ts b/examples/node/enter-spec-mode.ts index ad1c269..2cae819 100644 --- a/examples/node/enter-spec-mode.ts +++ b/examples/node/enter-spec-mode.ts @@ -6,7 +6,8 @@ * host app does when the user toggles spec mode on an open conversation. * * The permission handler prints the proposed plan (`ExitSpecMode`), approves - * it and the write to the output file, and cancels any other tool call. + * it, the write to the output file, and read-only commands, and cancels any + * other tool call. * * Usage: * npx tsx examples/node/enter-spec-mode.ts @@ -71,13 +72,17 @@ const handlePermissionRequest: ClientPermissionHandler = ({ } } - // Approve the plan and the write to outputPath. Cancel everything else. + // Approve the plan, the write to outputPath, and commands that Droid rates + // low impact (read-only), such as `od -c hello.txt` to check the bytes it + // wrote. Cancel everything else. A cancel ends the turn as interrupted. const expected = confirmations.length > 0 && confirmations.every( (details) => details.type === ToolConfirmationType.ExitSpecMode || - writesOnlyOutputFile(details) + writesOnlyOutputFile(details) || + (details.type === ToolConfirmationType.Execute && + details.impactLevel === 'low') ); const outcome = expected ? ToolConfirmationOutcome.ProceedOnce