Retain completion failures quietly #656

Merged
barrettruth merged 1 commit from fix/643-completion-failures into main 2026-05-06 22:42:17 +00:00
Owner

Summary

  • Records completion command and JSON decode failures in a low-noise state log.
  • Keeps completion itself silent while preserving contextual failure lines for later inspection.
  • Covers command failure, decode failure, and state-log dedupe/copy behavior.

Reproduction

Before coding, I loaded this checkout with system nvim via vim.pack + lz.n, configured the Forgejo host for this repo, and stubbed release-tag completion to fail with authentication output.

  • Before: Forge release delete returned no completions, sent no notification, and had no retained completion-failure diagnostic.
  • After: the same packed repro still returns no completions and sends no notification, but forge.state.completion_failures() retains the failure.
Before After
No retained diagnostic. failed to fetch release completions: authentication failed (request id abc123)
FAILURES_API=nil, NOTIFY_COUNT=0 FAILURES_API=function, FAILURE_COUNT=1, NOTIFY_COUNT=0

Verification

  • just test spec/command_spec.lua spec/state_spec.lua
  • just test
  • nix develop .#ci --command just ci

Closes #643

## Summary - Records completion command and JSON decode failures in a low-noise state log. - Keeps completion itself silent while preserving contextual failure lines for later inspection. - Covers command failure, decode failure, and state-log dedupe/copy behavior. ## Reproduction Before coding, I loaded this checkout with system nvim via vim.pack + lz.n, configured the Forgejo host for this repo, and stubbed release-tag completion to fail with authentication output. - Before: `Forge release delete ` returned no completions, sent no notification, and had no retained completion-failure diagnostic. - After: the same packed repro still returns no completions and sends no notification, but `forge.state.completion_failures()` retains the failure. | Before | After | | --- | --- | | No retained diagnostic. | failed to fetch release completions: authentication failed (request id abc123) | | `FAILURES_API=nil`, `NOTIFY_COUNT=0` | `FAILURES_API=function`, `FAILURE_COUNT=1`, `NOTIFY_COUNT=0` | ## Verification - `just test spec/command_spec.lua spec/state_spec.lua` - `just test` - `nix develop .#ci --command just ci` Closes #643
Retain completion failures quietly
All checks were successful
quality / Test (pull_request) Successful in 17s
quality / Lint (pull_request) Successful in 19s
quality / Format (pull_request) Successful in 20s
a45aa2c0f8
barrettruth deleted branch fix/643-completion-failures 2026-05-06 22:42:18 +00:00
Sign in to join this conversation.
No description provided.