Repository navigation
fix: let enter-spec-mode approve read-only commands - #84
Open
factory-droid[bot] wants to merge 1 commit into
Open
factory-droid[bot] wants to merge 1 commit into
factory-droid[bot] wants to merge 1 commit into
Conversation
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>
Contributor
Author
|
Examples workflow on this branch ( All jobs passed. Every Node example passed 2 of 2 on ubuntu/Node 20, ubuntu/Node 22.23.5 and macOS/Node 22.23.5, with no retries. That includes |
This branch has not been deployed
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.
Description
What:
examples/node/enter-spec-mode.tsnow also approves shell commands that Droid rates low impact (read-only). It still cancels every other tool call except the plan and the write to the output file.Why: The scheduled Examples workflow failed on 2026-11-16, 17, 20, 21 and 22 with no change to
main(every run was ona410305). There were two failures:enter-spec-mode(11-20, 21, 22, across all three matrix jobs). After the plan is approved, Droid writeshello.txt. The Create tool storeshello\n, but the plan often says "no trailing newline". The model then checks the bytes with a read-only command (od -corwc -c). The handler cancelled that command, and a cancel ends the turn, soResult.successis false (Turn ended: interrupted). One retry often failed the same way.resume-session(11-16, 17). The model (gpt-6.1-solthen) tried a tool to "check the previous session".resumeSession()has no permission handler, so the SDK cancelled the call, which interrupted the turn. This has not happened since 11-18. It passed 6 of 6 local runs, so this PR leaves it unchanged.This is not a Droid CLI regression. The
enter-spec-modefailure reproduces at the same rate on droid 1.12.1, the version from the last passing days, and on 1.17.2 (2 of 4 failed on each, with retries off). The handler logs from those runs show the cancelledexecconfirmation withimpactLevel: "low"every time.How: I added one more allowed case to the handler:
ToolConfirmationType.ExecutewithimpactLevel === 'low'. That uses Droid's own "read-only command" classification, the same oneAutonomyLevel.Lowuses. The example still cancels writes to other paths and any command Droid rates medium or high impact.Validation
npm test,npm run typecheck,npm run lint,npm run format:check,npm run check:docs: all pass.node scripts/run-examples.mjs --only enter-spec-mode --retries 0, droid 1.17.2:od -c)workflow_dispatch(all three node matrix jobs plus browser): linked in a comment below.No unit test: the handler is inline in a runnable example, and
npm testmakes no model calls. The live harness above is the check that turns red without this change.