Skip to content

Show catalog load failure as an error, not an empty picker (CL-6831) - #595

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-6831-agent-model-catalog-error-looks-like-an-empty-picker
Sep 4, 2026
Merged

TheGreatAxios merged 3 commits into
mainfrom
cl-6831-agent-model-catalog-error-looks-like-an-empty-picker

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

A failed resolved-catalog load on the workbench-settings agent model picker used to look like an empty dropdown: CatalogState error had no message, the select stayed enabled, and the empty-ready hint only rendered for kind === "ready". The catch now stores describeChatError copy, disables the select, and offers Retry plus a Shared Settings hop. It does not reuse the empty-catalog "No connected providers yet" string.

Verification

  • cd packages/chat-ui && bun test test/agents-section.test.tsx: new catalog-failure cases failed before the implementation (select still enabled), then 23 pass, 0 fail (exit 0) after.
  • cd packages/chat-ui && bun test test/agents-section.test.tsx src/workbench-settings/agents-section.test.ts: 30 pass, 0 fail (exit 0).
  • bun run typecheck: exit 0.
  • bun run lint: prettier clean; eslint 0 errors / 10 pre-existing warnings.
  • bunx eslint --cache packages/chat-ui/src/workbench-settings/agents-section.tsx packages/chat-ui/src/strings.ts packages/chat-ui/test/agents-section.test.tsx: exit 0.
  • Full bun run check / bun run test reach scripts/db-setup.test.ts and fail with PostgresError: password authentication failed for user "thegreataxios" (pre-existing local DATABASE_URL, unrelated).

Fixes CL-6831

A failed resolved-catalog load currently leaves the picker looking empty.
These cases pin an inventory-style error, a disabled select, Retry plus a
Settings hop, and copy that is not the empty-ready hint.
The resolved-catalog catch now keeps a message via describeChatError,
disables the model select, and offers Retry plus a Shared Settings hop
instead of looking like a connected-providers empty state.
getResolvedCatalog throws InferenceSettingsApiError, whose message is
the envelope userMessage. describeChatError only handled ChatApiError,
so a catalog 500 always fell through to "Couldn't load the models."
@linear-code

linear-code Bot commented Sep 3, 2026

Copy link
Copy Markdown

CL-6831

@TheGreatAxios

Copy link
Copy Markdown
Contributor Author

Self-review

Verdict: the fix is correct — describeChatError now recognizes InferenceSettingsApiError, surfaces its safe userMessage on unmapped statuses, the select disables on kind: "error", and Retry/Shared-Settings actions are wired through a reload key. No defects found; nothing changed.

  • describeChatError's 401/403/undefined-status mapping and InferenceSettingsApiError handling: DISMISSED — verified against InferenceSettingsApiError (packages/inference-settings/src/api.ts), whose message is always the parsed envelope's userMessage (safe to show) or a generic "server answered N" string, never a raw path; the ChatApiError 500 case still returns the generic fallback, so no regression there.
  • /settings/connections hop target: DISMISSED — matches the existing route (packages/settings-ui/src/connections-section.tsx, packages/connections/src/oauth-routes.ts), not a fabricated path.
  • Retry wiring (catalogReloadKey in the effect deps, resetting to loading on each run): DISMISSED — re-read the effect; it cancels the prior run via the cancelled closure and correctly clears the previous error/models on retry.
  • CatalogState exhaustiveness / ModelSelect disabled + hint conditions after adding the error variant: DISMISSED — typecheck passes, no orphaned branches.

Targeted tests (from packages/chat-ui, in the PR's worktree): bun test test/agents-section.test.tsx test/api.test.ts src/workbench-settings/agents-section.test.ts → 73 pass, 0 fail. bun run typecheck → exit 0.

@TheGreatAxios
TheGreatAxios merged commit 4c25c87 into main Sep 4, 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.

1 participant