fix: preserve provider errors in user profile learning - #267
Merged
Conversation
Collaborator
Author
|
Reviewer quick guide: This is a 3-line source change mirroring the exact pattern already merged in #258 (auto-capture error preservation, reviewed by @NaNomicon). Source diff (
Test: Risk: Minimal — only changes the error message surfaced to users when their primary provider is broken and no fallback exists. The happy path and fallback path are untouched. |
phil-lipp
pushed a commit
to phil-lipp/opencode-mem
that referenced
this pull request
Aug 25, 2026
…or propagation - pin bun-types to 1.3.14 via overrides: @types/bun 1.4.0 narrows the NodeJS.Process event surface (memoryPressure-only), which breaks process.on(SIGINT/SIGTERM/beforeExit/exit) typecheck on main - rethrow in performUserProfileLearning after logging so provider errors keep propagating per tickernelz#267/tickernelz#265 instead of being silently swallowed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the opencode provider path in
analyzeUserProfile()throws and no manual external API fallback (memoryModel/memoryApiUrl) is configured, the original provider error was silently replaced by a generic"External API not configured for user memory learning"message. This made debugging provider failures (e.g. unsupportedtool_choicein thinking mode) impossible from logs.Changes
user-profile-learning-error.test.tsthat mocks a throwing opencode provider with no fallback and verifies the surfaced error contains the real root cause.Testing
bun test tests/user-profile-learning-error.test.ts— 1/1 passtsc --noEmitcleanCloses #265