-
Notifications
You must be signed in to change notification settings - Fork 263
Closed as not planned
Closed as not planned
Copy link
Description
Description
Standardize console output to use fmt.Fprintln(os.Stderr, ...) instead of fmt.Println(...) in the workflow package (~15 occurrences) to ensure consistent output handling and prevent issues with piped/redirected output.
Problem
Current State:
- ~15 occurrences of
fmt.Println(console.Format...)in workflow package - Output goes to stdout instead of stderr
- Inconsistent with codebase guidelines in AGENTS.md
- Can break when output is piped or redirected
Why it's problematic:
- All user-facing output should go to stderr (except JSON output)
- Current pattern:
fmt.Println(console.FormatInfoMessage(...)) - Correct pattern:
fmt.Fprintln(os.Stderr, console.FormatInfoMessage(...)) - Breaks piping and redirection expectations
Suggested Changes
Update all console output calls to use stderr:
// ❌ CURRENT - Output to stdout
fmt.Println(console.FormatInfoMessage("Refreshed stop-after time"))
// ✅ CORRECT - Output to stderr
fmt.Fprintln(os.Stderr, console.FormatInfoMessage("Refreshed stop-after time"))Files Affected
Approximately 15 occurrences across:
pkg/workflow/stop_after.go(lines 81-354)pkg/workflow/engine_firewall_support.go(line 72)pkg/workflow/mcp-config-custom.go- Other workflow package files
Success Criteria
- All
fmt.Println(console.Format...)calls changed tofmt.Fprintln(os.Stderr, console.Format...) - Consistent stderr usage across workflow package
- All existing tests pass:
make test - Output correctly appears in stderr (not stdout)
- Follows guidelines documented in AGENTS.md
Implementation Strategy
- Identify all occurrences:
grep -r "fmt.Println(console\\.Format" pkg/workflow/ - Replace pattern systematically file by file
- Test each file after changes
- Run full test suite to ensure no regressions
Source
Extracted from Terminal UI Analysis: Console Output Patterns discussion #10958
Priority
Medium - Improves output consistency and prevents piping issues
Estimated Effort
Medium - 1-2 hours to fix ~15 occurrences and test
AI generated by Discussion Task Miner - Code Quality Improvement Agent
- expires on Feb 4, 2026, 2:09 PM UTC
Reactions are currently unavailable