You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: capture agent output for later workflow steps (#32) (#56)
* Fix: capture agent output for later workflow steps (#32)
Agent steps currently discard their output after streaming it to the terminal, so later steps cannot inspect sentinel values like blocked status tags.
Changes:
- Add capture to AgentStep with shell-variable validation
- Render captured agent output into a shell variable while preserving uncaptured streaming behavior
- Add parser, schema, and runtime tests plus README coverage
Fixes#32
* Archive investigation for issue #32
* Fix: preserve captured agent failures (#32)
-#32: `[Important] capture: field on agent steps to expose output to subsequent steps`
6
+
- Type: ENHANCEMENT
7
+
8
+
## Investigation Summary
9
+
10
+
Agent steps streamed their output to the terminal and discarded it, so later workflow steps could not inspect sentinel values such as blocked-status tags.
11
+
12
+
## Implementation Plan
13
+
14
+
- Add `capture: str | None = None` to `AgentStep` in `src/flowsh_cli/models.py`
15
+
- Validate `capture` as an uppercase shell variable name
16
+
- Render captured agent output into a shell variable in `src/flowsh_cli/render.py`
17
+
- Add parser, schema, and end-to-end tests in `tests/test_workflow_to_harness.py`
18
+
- Document `capture` in `README.md`
19
+
20
+
## Validation
21
+
22
+
-`make qa`
23
+
24
+
## Notes
25
+
26
+
The fix was implemented on branch `fix/issue-32-agent-capture`.
| `for` | Iterate over newline-delimited values from a previous `vars` step | Flat iteration only; nested `for` steps are not supported. |
84
84
| `while` | Re-evaluate a Bash condition before each iteration | Use for dynamic queues or other stateful loops that must keep discovering new work. |
85
85
| `parallel` | Run child steps concurrently | Children run as separate branches and the parent waits for all of them. |
@@ -90,6 +90,8 @@ Harness paths are derived from workflow ids. `wf_example` becomes `example.sh` i
90
90
91
91
`expandPrompt: true` does plain text replacement only. It does not evaluate shell expressions like `$(...)`, backticks, or globs.
92
92
93
+
Set `capture: VARIABLE_NAME` on an `agent` step when you want the full OpenCode output stored in a shell variable for later `vars` or `bash` steps.
94
+
93
95
Set `dangerouslySkipPermissions: true` only when you want the generated harness to pass `--dangerously-skip-permissions` to OpenCode. The YAML alias `dangerously-skip-permissions` is also accepted.
0 commit comments