[Feature]: capture mode for command and prompt workflow steps
还没有人认领这个 Issue。
评估
调研方向
Start with src/specify_cli/workflows/steps/command/init.py and the existing ShellStep capture pattern, then inspect prompt/init.py, validators.py, and IntegrationBase.dispatch_command(). Add regression coverage in tests/test_workflows.py for opt-in command and prompt capture, validation, and timeout behavior; done means captured stdout/stderr reach downstream step outputs while default streaming remains unchanged.
由索引模型根据 Issue 内容生成。
描述
Problem
Workflow command and prompt steps always stream output to the terminal. The stdout and stderr fields in the step output dict are always empty strings, making them inaccessible to downstream steps via {{ steps.<id>.output.stdout }}.
This limits workflow authors who need to:
- Parse AI agent output and branch on its content
- Pipe command output into a later step as structured data
- Conditionally act on specific output patterns (e.g. exit messages, generated file paths)
The command step docstring (line 26) notes this as a planned enhancement:
Full
stdout/stderrcapture is a planned enhancement.
Proposed Solution
Add an opt-in capture: true field to command and prompt step configs. When set, dispatch uses capture_output=True so stdout and stderr are returned in the step output dict and accessible to downstream steps.
# Before (streaming, stdout/stderr always empty):
- id: plan
type: command
config:
command: speckit.plan
integration: claude
# After (capture mode, stdout/stderr available):
- id: plan
type: command
config:
command: speckit.plan
integration: claude
capture: true
timeout: 300
Downstream steps can then reference:
- id: parse
type: shell
config:
command: "echo '{{ steps.plan.output.stdout | from_json }}'"
Design Notes
- Backward compatible:
capturedefaults tofalse; existing workflows are unaffected - Follows existing pattern:
ShellStepalready captures output withcapture_output=Trueand supportsoutput_format: json - Timeout support: A
timeoutfield (seconds, default 600) prevents hung commands from blocking the workflow, consistent withdispatch_command()default - Implementation: Requires forwarding
stream=not capturetoIntegrationBase.dispatch_command()which already supports both modes
Affected Files
src/specify_cli/workflows/steps/command/__init__.py- config schema, dispatch call, output assemblysrc/specify_cli/workflows/steps/prompt/__init__.py- same pattern for prompt stepssrc/specify_cli/workflows/validators.py-capture(bool) andtimeout(int) validationtests/test_workflows.py- capture mode regression tests
Questions
- Does this direction align with your roadmap for the workflow engine?
- Should capture mode also apply to the
promptstep, or onlycommandsteps? - Any preferences on the field name (
capturevscapture_outputvs something else)?
Happy to implement if this is something you'd like to move forward with.
- 主要语言
- Python
- 星标
- 138k
- 派生
- 12.4k
- 平均合并
- 3 天 4 小时
- 30 天内合并 PR
- 154
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/spec-kit 的其他 Issue
-
enhancement needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
-
enhancement needs-triage
难度 2/5 1-3 小时 新手友好度 74/100
-
enhancement needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 84/100
-
enhancement needs-triage triage-can-wait
难度 2/5 1-3 小时 新手友好度 76/100
相似的 Issue
-
essnmx good first issue
难度 1/5 1 小时以内 新手友好度 95/100
-
难度 2/5 1-3 小时 新手友好度 65/100
syfoud/Simulated_Scepter#174 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
Giskard-AI/giskard-oss#2840 · 1 条评论 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success 未关闭area: repo bug perceived difficulty: 2
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
yeti-platform/yeti#1380 ·