Tracker: error handling and edge cases #634

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

Problem

Forge currently surfaces too many command and backend failures as generic notifications such as merge failed, update failed, or creation failed. That is not enough when the underlying forge CLI often prints actionable stderr/stdout explaining merge conflicts, authentication failures, missing permissions, missing network, malformed JSON, or unavailable API endpoints.

The error handling surface needs a v0.2.0 pass across PRs, issues, CI, releases, pickers, terminal-backed views, backend browse/probe paths, and completions.

Goal

Make failed operations explain what failed and preserve enough command context to debug it without dumping unbounded raw output into normal notifications.

Desired shape

  • Shared formatting for command failures, including action context, exit code, and useful stderr/stdout excerpts.
  • Consistent behavior across direct commands, picker actions, compose flows, CI buffers, and terminal views.
  • Tests for representative failure modes: merge rejection, network/auth failure, invalid JSON, empty output, terminal spawn failure, and completion command failure.
  • Backend-specific semantics stay explicit where GitHub, GitLab, and Forgejo differ.

Subissues

  • #635 Preserve CLI failure context in shared system errors
  • #636 Make PR, issue, release, and CI mutation failures actionable
  • #637 Retain fetch, decode, and parser detail in edit-open flows
  • #638 Standardize picker fetch and decode error rows
  • #644 Guard picker row building after successful JSON decode
  • #645 Stop CI and checks pipelines from swallowing CLI failures
  • #646 Make repo info, PR state, and current-PR lookups fallible
  • #639 Show structured command failures in CI log and summary buffers
  • #640 Surface auxiliary CI status and steps command failures
  • #641 Report terminal spawn and exit failures for live CI views
  • #642 Normalize backend browse and subject-probe failure handling
  • #643 Retain completion command failures without noisy notifications

Suggested order

  1. #635 establishes the shared failure shape.
  2. #636 and #637 apply it to core user actions and edit-open fetches.
  3. #638 and #644 harden picker list fetch/build surfaces.
  4. #645 and #646 prevent backend command builders/lookups from erasing failures before they reach the shared layer.
  5. #639, #640, and #641 cover CI child buffers and terminal-backed views.
  6. #642 and #643 handle backend browse/probe and completion-specific low-noise behavior.

Non-goals

  • Do not change successful operation behavior.
  • Do not dump full logs or unbounded command output into notifications.
  • Do not hide backend-specific CLI behavior behind false generic abstractions.
  • Do not fix unrelated backend bugs inside this tracker.
## Problem Forge currently surfaces too many command and backend failures as generic notifications such as `merge failed`, `update failed`, or `creation failed`. That is not enough when the underlying forge CLI often prints actionable stderr/stdout explaining merge conflicts, authentication failures, missing permissions, missing network, malformed JSON, or unavailable API endpoints. The error handling surface needs a v0.2.0 pass across PRs, issues, CI, releases, pickers, terminal-backed views, backend browse/probe paths, and completions. ## Goal Make failed operations explain what failed and preserve enough command context to debug it without dumping unbounded raw output into normal notifications. ## Desired shape - Shared formatting for command failures, including action context, exit code, and useful stderr/stdout excerpts. - Consistent behavior across direct commands, picker actions, compose flows, CI buffers, and terminal views. - Tests for representative failure modes: merge rejection, network/auth failure, invalid JSON, empty output, terminal spawn failure, and completion command failure. - Backend-specific semantics stay explicit where GitHub, GitLab, and Forgejo differ. ## Subissues - [ ] #635 Preserve CLI failure context in shared system errors - [ ] #636 Make PR, issue, release, and CI mutation failures actionable - [ ] #637 Retain fetch, decode, and parser detail in edit-open flows - [ ] #638 Standardize picker fetch and decode error rows - [ ] #644 Guard picker row building after successful JSON decode - [ ] #645 Stop CI and checks pipelines from swallowing CLI failures - [ ] #646 Make repo info, PR state, and current-PR lookups fallible - [ ] #639 Show structured command failures in CI log and summary buffers - [ ] #640 Surface auxiliary CI status and steps command failures - [ ] #641 Report terminal spawn and exit failures for live CI views - [ ] #642 Normalize backend browse and subject-probe failure handling - [ ] #643 Retain completion command failures without noisy notifications ## Suggested order 1. #635 establishes the shared failure shape. 2. #636 and #637 apply it to core user actions and edit-open fetches. 3. #638 and #644 harden picker list fetch/build surfaces. 4. #645 and #646 prevent backend command builders/lookups from erasing failures before they reach the shared layer. 5. #639, #640, and #641 cover CI child buffers and terminal-backed views. 6. #642 and #643 handle backend browse/probe and completion-specific low-noise behavior. ## Non-goals - Do not change successful operation behavior. - Do not dump full logs or unbounded command output into notifications. - Do not hide backend-specific CLI behavior behind false generic abstractions. - Do not fix unrelated backend bugs inside this tracker.
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#634
No description provided.