Preserve CLI failure context in shared system errors #635

Closed
opened 2026-05-06 19:55:41 +00:00 by barrettruth · 0 comments
Owner

Parent: #634

Problem

forge.system.cmd_error() currently chooses stderr, else stdout, else a fallback. That loses exit code, command context, and the lower-priority stream, even when both streams contain useful information. This feeds operation notifications, compose flows, CI fetches, review fetches, and picker failures.

Scope

  • Define a shared command-failure formatter/shape.
  • Preserve action context, exit code, stderr excerpt, stdout excerpt, and command identity where appropriate.
  • Add focused tests for stderr-only, stdout-only, mixed-stream, blank-output, and nonzero-exit cases.

Non-goals

  • Do not dump full command output into notifications.
  • Do not change backend command semantics.
Parent: #634 ## Problem `forge.system.cmd_error()` currently chooses stderr, else stdout, else a fallback. That loses exit code, command context, and the lower-priority stream, even when both streams contain useful information. This feeds operation notifications, compose flows, CI fetches, review fetches, and picker failures. ## Scope - Define a shared command-failure formatter/shape. - Preserve action context, exit code, stderr excerpt, stdout excerpt, and command identity where appropriate. - Add focused tests for stderr-only, stdout-only, mixed-stream, blank-output, and nonzero-exit cases. ## Non-goals - Do not dump full command output into notifications. - Do not change backend command semantics.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
barrettruth/forge.nvim#635
No description provided.