fix(workflows): keep the init step's documented ignore_agent_tools default on an explicit null - #3889
Open
jawwad-ali wants to merge 1 commit into
Open
Conversation
…fault on an explicit null
The step documents the default twice:
class docstring: "Because workflows run unattended, the step defaults to
``--ignore-agent-tools``"
field docs: "Skip checks for the coding agent CLI (defaults to ``true``)"
It implements that with `config.get("ignore_agent_tools", True)`, which
applies the default only when the key is ABSENT. A bare
`ignore_agent_tools:` in YAML parses to None, and `_resolve_bool(None)`
returns False:
key ABSENT -> True flag emitted: YES
bare ignore_agent_tools: -> False flag emitted: NO <-- bug
explicit true -> True flag emitted: YES
explicit false -> False flag emitted: NO
So the flag is dropped, `specify init` re-runs the agent-CLI presence
check, and an unattended run fails with "Agent Detection Error" for any
integration whose CLI is not installed on the runner.
Normalize an explicit null to the default, mirroring the while/do-while
`max_iterations` handling.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.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.
Problem
InitStepdocuments this default in two places:It implements it as:
config.get(key, default)substitutes the default only when the key is absent. A bareignore_agent_tools:in YAML parses toNone, and_resolve_bool(None)→bool(None)→False.Reproduction on current
main(81bf741)So
--ignore-agent-toolsis dropped,specify initre-runs the agent-CLI presence check, and an unattended workflow run fails with "Agent Detection Error" for any integration whose CLI is not installed on the runner — the precise failure the documented default exists to avoid.A bare key is a normal YAML authoring shape, and it reads as "leave this at its default", which is the opposite of what happened.
Fix
Normalise an explicit null to the documented default before resolving:
This mirrors how the while/do-while steps handle
max_iterations—config.get("max_iterations")followed by an explicitif ... is Nonedefault, rather than relying on.get's default.No breaking change. An absent key, an explicit
true, and an explicitfalseall behave exactly as before — a second new test pins thatfalsestill opts in to the agent check. The only input whose behaviour changes is the explicit null, which moves from silently inverting the documented default to honouring it.Verification
test_explicit_null_ignore_agent_tools_keeps_documented_defaultfails on unpatchedsrcand passes with the fix.tests/test_workflows.py: 21 failed → 20 failed, 838 → 839 passed.mainbaseline I captured on81bf741(all Windows symlink-privilege).uvx ruff@0.15.0 check src tests→ cleanTests go into the existing
TestInitStep, besidetest_builds_here_argv_and_bootstraps, which already asserts--ignore-agent-toolsis in the argv.Written with assistance from Claude Code. Bug found, reproduced, and verified by me on current
main.