fix(bundler): pass explicit option values when delegating to workflow_add - #4135
Open
jawwad-ali wants to merge 1 commit into
Open
fix(bundler): pass explicit option values when delegating to workflow_add#4135jawwad-ali wants to merge 1 commit into
workflow_add#4135jawwad-ali wants to merge 1 commit into
Conversation
…_add
`specify bundle install` can never install a workflow component. It fails
100% of the time with a nonsensical error about `--dev`.
The bundler delegates to the Typer command callables in-process:
lambda: workflow_add(component.id)
`workflow_add` declares two `typer.Option` parameters. Called from Python
rather than through Typer, those keep their `OptionInfo` sentinels as the
value — and the sentinel is truthy and is not None:
dev default -> OptionInfo truthy=True
from_url default -> OptionInfo is None=False
So `if dev:` takes the local-path branch for every catalog install:
Error: --dev source must be a workflow YAML file, supported archive, or
directory containing workflow.yml: code-review
BundlerError: Failed to install workflow 'code-review'.
`workflow_add` is the only one of the four delegated commands that declares
options; workflow_remove / workflow_step_add / workflow_step_remove take a
bare `typer.Argument` and are safe as written.
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
specify bundle installcan never install a workflow component. It fails 100% of the time, with an error about--devthat has nothing to do with what the user asked for.bundler/services/primitives.pydelegates to the Typer command callables in-process, as its module docstring describes:But
workflow_adddeclares twotyper.Optionparameters (workflows/_commands.py:1712-1716):Called from Python rather than through Typer, an omitted option parameter keeps its
OptionInfosentinel as the value:So
if dev:is always true and the function takes the local-path branch.Reproduction on current
main(bf88c9f)The catalog install path is unreachable.
Why only this call site
A signature survey of all four delegated callables:
workflow_addsource=ArgumentInfo, dev=OptionInfo, from_url=OptionInfoworkflow_removeworkflow_id=ArgumentInfoworkflow_step_addstep_id=ArgumentInfoworkflow_step_removestep_id=ArgumentInfoworkflow_addis the only one that declares options, and it is the only call site that omits them — so the other three are safe exactly as written, and this fix is correctly scoped to one line.Fix
No breaking change. No input that works today behaves differently — today every bundler workflow install fails; afterwards it reaches the catalog path the code always intended.
Verification
srcand passes with the fix — 1 failed → 21 passed.dev is Falseandfrom_url is None, so a future regression to sentinels is caught rather than silently swallowed by a**kwargsstub.lambda wid: ...) had to accept the kwargs; I made it capture them instead of discarding them.tests/unit: no new failures vs a clean-mainbaseline captured onbf88c9f9.uvx ruff@0.15.0 check src tests→ cleanWritten with assistance from Claude Code. Bug found, reproduced, and verified by me on current
main.