Follow-up to #1173, requested by @robinebers in this review comment:
Could you send a small follow-up PR for unreadable plan responses? If /api/me returns 200 OK with malformed data, the plan badge currently disappears without a user-visible warning. Keep the usage meters working, but show the same gentle warning used for failed plan requests.
Current behavior OllamaProvider warns when the /api/me request fails (transport error or non-2xx). But when it returns 200 OK with a body OpenUsage can't read — not a JSON object, or a plan field that has been renamed or is no longer a string — plan resolution just yields nil. The badge vanishes with no warning and no log line: the same silent disappearance the existing warning was added to prevent.
Proposed fix. Have plan resolution report three outcomes rather than an optional string:
- a usable plan name → show the badge,
- an explicitly empty plan → an account that has no plan; show no badge and stay quiet, since that is ordinary,
- anything unreadable → show no badge and carry the same warning a failed request already produces.
The middle case is worth keeping separate: warning on it would nag every user whose account legitimately reports no plan.
Regression test included for the 200 OK + unreadable body case, which the existing tests miss (they cover HTTP 500 only).
Implemented and ready to open as a PR. Could you add the approved label and assign it to me so the PR-policy workflow accepts it? (#1066 is closed now that #1173 merged, so it can no longer serve as the linked issue.)
Follow-up to #1173, requested by @robinebers in this review comment:
Current behavior
OllamaProviderwarns when the/api/merequest fails (transport error or non-2xx). But when it returns200 OKwith a body OpenUsage can't read — not a JSON object, or a plan field that has been renamed or is no longer a string — plan resolution just yieldsnil. The badge vanishes with no warning and no log line: the same silent disappearance the existing warning was added to prevent.Proposed fix. Have plan resolution report three outcomes rather than an optional string:
The middle case is worth keeping separate: warning on it would nag every user whose account legitimately reports no plan.
Regression test included for the
200 OK+ unreadable body case, which the existing tests miss (they cover HTTP 500 only).Implemented and ready to open as a PR. Could you add the
approvedlabel and assign it to me so the PR-policy workflow accepts it? (#1066 is closed now that #1173 merged, so it can no longer serve as the linked issue.)