Feat: Add OpenCode run parameters to agent steps - #18
Merged
Conversation
Workflow authors could only pass agent and prompt values to OpenCode, leaving model, command, and explicit permission-skip controls unavailable from strict YAML. This extends the existing Python blueprint without adding step types or dependencies, while preserving prompt handling after the -- sentinel. Changes: - Add strict AgentStep fields for model, command, and dangerous permission skipping - Render new OpenCode flags through the existing Bash array before prompt content - Cover parser validation, schema exposure, generated harness argv, and README docs Pattern: Follows existing AgentStep validation and run_agent Bash array composition Decision: Reject both dangerous aliases together to avoid silent AliasChoices priority Related: src/flowsh_cli/models.py, src/flowsh_cli/render.py, tests/test_workflow_to_harness.py
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
Flowsh agent steps could only express
agent,prompt, andexpandPrompt. Workflows that needed OpenCode's non-interactive--model,--command, or explicit--dangerously-skip-permissionsflags were rejected by strict YAML validation instead of rendering the intendedopencode runinvocation.Solution
Extend the existing Python CLI blueprint in place. The
AgentStepmodel now acceptsmodel,command, anddangerouslySkipPermissions, withdangerously-skip-permissionsas an accepted alias. Generated harnesses keep the existing Bash array command pattern and append all optional OpenCode flags before--, so prompt text remains message content.Changes
src/flowsh_cli/models.pywith strict optional fields, shared string validation, and duplicate dangerous-alias rejection.src/flowsh_cli/render.pyto pass--agent,--model,--command, and--dangerously-skip-permissionsthroughrun_agent().tests/test_workflow_to_harness.py.README.mdwith the supported YAML and security-sensitive dangerous permission behavior..claude/PRPs/.Testing
make lint: passed.uv run --locked pytest tests/test_workflow_to_harness.py -q: 76 passed.make build && uv run --locked flowsh-cli --schema: passed; schema includes newAgentStepfields.make qa: passed locally and again in the push hook with 76 tests passing and package build succeeding.Example Output
Notes
modelvalues intentionally allow provider/model IDs likeopenai/gpt-5; they do not reuse the stricteragentname regex.