Repository navigation
Keep script automation settings on partial updates - #6465
Merged
ymichael merged 1 commit intoOct 28, 2026
Merged
Conversation
`bb automation update` with any script flag replaced the whole script execution, so refreshing a script dropped its env vars and reset its timeout, and `--env-json` could not be updated on its own. Script updates now patch only the given fields; script flags on an agent automation still replace it with a script. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/automation-update-wipes-script-env-vars-thr_64jggvwniv
branch
October 28, 2026 19:35
pZayash
added a commit
to pZayash/bb
that referenced
this pull request
Nov 3, 2026
The merge kept the pre-get-bb#6465 refreshScriptFileCommand that re-expanded --interpreter/--working-directory/--timeout/--env-json, and the test's expected command was left incoherent. Since update --script-file is now a partial update that preserves script settings, the refresh command is just --script-file <path> [--host ...]. Keep only the forkShellQuote seam. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.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.
Human comments
What was wrong
bb automation updatetreated any script flag (--script,--script-file,--interpreter,--timeout,--env-json) as a complete replacement of the script execution. The only partial script update theautomations_updateRPC accepted wasscript: { workingDirectory }. So refreshing a script withupdate <id> --script-file ./check.shsilently dropped its env vars and resettimeoutMsto the 120000 default, while the working directory happened to carry over.update <id> --env-json '{...}'on its own was rejected withProvide an execution mode: .... The UI hits the same path: it edits only agent automations inline, and "Edit in thread" for a script automation has an agent run this CLI command.Reproduced on a fresh
pnpm start:worktreeserver: after a script-only update, the stored execution had noenvandtimeoutMs: 120000(was 30000), and the next run printedBuild under test:with empty vars.What changed
rpc-types.ts: thescriptupdate onautomations_updatenow accepts any subset ofscript,scriptFile(requiresscript),interpreter,timeoutMs,env,workingDirectory. The previous{ workingDirectory }shape is still valid.service.ts: newapplyScriptExecutionUpdatepatches the current script execution and keeps omitted fields. New content is staged and the superseded file cleaned up the same way as a full replacement. An emptyenvremoves the variables.cli.ts: script flags on a script automation send a partialscriptupdate. Script flags on an agent automation still build a full replacement, so agent→script switching is unchanged; the CLI reads the current mode to decide. Mixing agent and script flags is rejected. The printed refresh command is now just--script-file <path> [--host …].--script-filewithout--interpreterkeeps the current interpreter rather than re-inferring it from the extension. Documented.SKILL.md,references/updates.md,references/script-runtime.md, andupdate/--interpreterhelp text.--prompt --provider --modeltogether still replace an agent's whole execution, including its environment target. Now stated in the docs.No daemon wire changes.
How you verified
server-harness.test.ts: extended the end-to-end CLI→RPC flow with a content-only update, an env-only update, clearing with--env-json '{}', and rejection of mixed agent and script flags. Against the unfixed source it fails on the droppedenv.automations.test.ts: the refresh-command test now edits the source file and runs the printed command, then checks that interpreter, timeout, env and working directory are kept and the new content is stored.pnpm exec turbo run typecheck lint test --filter=bb-plugin-automations: 140/140 tests pass.pnpm start:worktreeserver with the source CLI: a script-only update keptenvandtimeoutMs: 30000, and the run printedBuild under test: L1with both paths. An env-only update applied, and the old stored file was removed.🤖 Generated with Claude Code