[Feature]: capture mode for command and prompt workflow steps
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 138k
- Fork
- 12.4k
- Merge trung bình
- 3 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 154
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/spec-kit
-
enhancement needs-triage triage-can-wait
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
preset-submission triage-must-have validation-passed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
extension-submission triage-must-have validation-passed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
extension-submission triage-can-wait validation-passed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
[Feature]: 给 slug 添加默认值 Đang mởenhancement needs-triage triage-can-wait
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Tất cả issue của github/spec-kit
Issue tương tự
-
bug confirmed issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
open-webui/open-webui#30750 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100