Skip to content

fix(cli): surface API cache write failures instead of silently re-syncing#28

Merged
HappySean2845 merged 1 commit into
mainfrom
sean/spec-cache-stderr
Jun 10, 2026
Merged

fix(cli): surface API cache write failures instead of silently re-syncing#28
HappySean2845 merged 1 commit into
mainfrom
sean/spec-cache-stderr

Conversation

@HappySean2845

Copy link
Copy Markdown
Contributor

Why

In diver instant-eval pods ~92% of questions hit No cached API spec, syncing... on every surf call. One contributing factor: cacheAPI() swallows Cache.WriteConfig() errors, so when the expiry write fails the CLI silently degrades into re-syncing the spec on every invocation with no clue why.

What

  • Log Cache.WriteConfig() failure to stderr with the reason (and a hint that next runs will re-sync)
  • Include the target file path in the cbor cache write error

No behavior change on the happy path; stdout JSON untouched.

Testing

go build / go vet clean; go test ./cli passes (TestRequestRetryAfter skipped — hangs under local proxy, pre-existing).

🤖 Generated with Claude Code

…cing

Cache.WriteConfig() errors were swallowed, so a failed expiry write made
every subsequent invocation treat the spec cache as missing and re-sync
('No cached API spec, syncing...' on each call). Log the failure reason
to stderr, and include the file path in the cbor cache write error.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@HappySean2845
HappySean2845 merged commit d298f7c into main Jun 10, 2026
3 checks passed
@HappySean2845
HappySean2845 deleted the sean/spec-cache-stderr branch June 10, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant