Skip to content

feat: show warning toast when opencode provider fails but fallback is configured - #270

Merged
tickernelz merged 1 commit into
mainfrom
fix/provider-fallback-warning-toast
Aug 25, 2026
Merged

feat: show warning toast when opencode provider fails but fallback is configured#270
tickernelz merged 1 commit into
mainfrom
fix/provider-fallback-warning-toast

Conversation

@lindixu6-hash

Copy link
Copy Markdown
Collaborator

Summary

When the opencode provider throws and a manual external API fallback is configured, the error was previously only logged to console. The user had no indication that their primary provider was broken and auto-capture was silently using the fallback.

This adds a non-blocking warning toast (5s, variant warning) informing the user that the opencode provider failed and the fallback is being used. The original provider error is included (truncated to 100 chars) for debugging.

Changes

  • generateSummary now accepts ctx to access client.tui.showToast.
  • After the opencode provider catch block, if opencodeProviderError exists AND a manual fallback (memoryModel + memoryApiUrl) is configured AND showErrorToasts is enabled, a warning toast is shown.
  • The error toast path (no fallback configured) from fix: preserve opencode auto-capture errors #258 is unchanged.
  • When no provider error occurs, no toast is shown (existing behavior).

Testing

  • tsc --noEmit clean
  • Existing auto-capture tests pass (2/2)
  • Memory scope tests pass (4/4)

Follow-up from #259 review by @NaNomicon.

… configured

When the opencode provider throws and a manual external API fallback is
configured, the error was previously only logged. The user had no
indication that their primary provider was broken and memory capture
was silently using the fallback.

This adds a non-blocking warning toast (5s, variant 'warning')
informing the user that the opencode provider failed and the fallback
is being used. The original provider error is included (truncated to
100 chars) for debugging. The toast only fires when showErrorToasts is
enabled and does not block capture.

Follow-up from #259 review by NaNomicon.
@lindixu6-hash

Copy link
Copy Markdown
Collaborator Author

Reviewer quick guide: This PR adds a non-blocking warning toast when the opencode provider fails but a manual fallback is configured. Previously the error was only logged, leaving users unaware their primary provider was broken.

Source diff (src/services/auto-capture.ts, ~20 lines):

  • generateSummary now accepts ctx to access showToast
  • After catching an opencode provider error, if a manual fallback exists AND showErrorToasts is enabled, show a 5s warning toast with the truncated error
  • The error-rethrow path from fix: preserve opencode auto-capture errors #258 (no fallback configured) is unchanged
  • The success path (no error) is unchanged

This addresses @NaNomicon's second follow-up from #259 review.

@tickernelz
tickernelz merged commit cdca457 into main Aug 25, 2026
7 checks passed
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.

2 participants