Commit 77743e8
fix(workflows): route 'workflow status --json' errors to stderr
The workflow_status run_id error paths (FileNotFoundError -> 'Run not found',
ValueError -> invalid run) used the stdout console and fired before the
json_output branch, so 'specify workflow status <bad-id> --json' wrote a
Rich-rendered error to stdout and corrupted the JSON stream a consumer would
json.loads(). Route both through _error_console(json_output) so they go to
stderr under --json, matching the sibling 'workflow run'/'workflow resume'
commands (which use the identical RunState.load try/except) and the documented
stdout-purity contract.
Test asserts the not-found error appears on stderr and stdout stays empty under
--json (fails before: the error was on stdout).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent faeb956 commit 77743e8
2 files changed
Lines changed: 29 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1262 | 1262 | | |
1263 | 1263 | | |
1264 | 1264 | | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
1265 | 1269 | | |
1266 | 1270 | | |
1267 | 1271 | | |
1268 | 1272 | | |
1269 | | - | |
| 1273 | + | |
1270 | 1274 | | |
1271 | 1275 | | |
1272 | | - | |
| 1276 | + | |
1273 | 1277 | | |
1274 | 1278 | | |
1275 | 1279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12455 | 12455 | | |
12456 | 12456 | | |
12457 | 12457 | | |
| 12458 | + | |
| 12459 | + | |
| 12460 | + | |
| 12461 | + | |
| 12462 | + | |
| 12463 | + | |
| 12464 | + | |
| 12465 | + | |
| 12466 | + | |
| 12467 | + | |
| 12468 | + | |
| 12469 | + | |
| 12470 | + | |
| 12471 | + | |
| 12472 | + | |
| 12473 | + | |
| 12474 | + | |
| 12475 | + | |
| 12476 | + | |
| 12477 | + | |
| 12478 | + | |
| 12479 | + | |
| 12480 | + | |
12458 | 12481 | | |
12459 | 12482 | | |
12460 | 12483 | | |
| |||
0 commit comments