🤖 fix: move the TypeSafe key to Providers settings and drop the duplicate tier id - #4331
Conversation
…cate tier id The auto-model-routing experiment panel managed the TypeSafe API key itself; provider credentials belong in the Providers section, so the key controls now live there as an Evaluation row (shown while the experiment is on). The tier header also printed the tier id next to the editable label, so each tier read twice on one line; the id is an internal slug and is no longer shown.
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21f9061d8c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…s on collapse (coder#4334) ## Summary Two follow-ups to coder#4331 for the Codex findings that landed after the merge queue had already picked that PR up (its earlier code and security reviews were clean; a second review was auto-triggered by marking the PR ready). ## Implementation - The TypeSafe card's status probe now targets the saved TypeSafe evaluation model from the auto-model-routing config, falling back to `typesafe:jev-latest` only when the saved evaluator belongs to another provider. Under an enforced policy whose `model_access` allows the saved model but not the default, the card previously reported the credential as not configured. - The key draft moved into a child editor that is mounted only while the card is expanded, so collapsing the card or opening another provider discards an unsaved key instead of restoring it on the next expand. The write itself and its busy/error outcome stay in the card, so a write that is rejected after the card collapsed still shows its error on the next expand instead of reporting to an unmounted editor. ## Validation - `TypeSafeProviderCard.test.tsx`: three new tests (probe follows a saved `typesafe:*` evaluator and falls back for other providers; an unsaved key is discarded across collapse/expand; a write rejected after collapse still surfaces its error on re-expand). Each fails on the pre-fix component and passes with it. ## Risks Low: confined to the TypeSafe card. No change to the write path or the evaluator credential resolution. --- _Generated with `xum` • Model: `anthropic:claude-fable-5-1` • Thinking: `xhigh` • Cost: `$21.61`_ <!-- mux-attribution: model=anthropic:claude-fable-5-1 thinking=xhigh costs=21.61 -->
Summary
Moves the TypeSafe evaluation API key out of the Auto model routing experiment panel into Settings > Providers as an Evaluation card, and stops the experiment's tier rows from printing each tier twice (label input plus internal id).
Background
The auto-model-routing experiment (#4307) owned the TypeSafe key controls (Save/Clear writing
typesafe.apiKeyinto providers.jsonc). Provider credentials belong to the Providers section. Separately, each tier row showed the editable label ("Easy") and, next to it, the tier id ("easy") in a monospace span; the id is an internal slug used as the evaluation choice key and carries no information for the user.Implementation
TypeSafeProviderCard.tsx(new): provider-style collapsible card (icon, name, status dot, API Key field with Save/Clear, status line fromgetAutoModelRoutingEvaluationStatusfor the defaulttypesafe:jev-latestevaluator). Writes through the existingproviders.setProviderConfig.ProvidersSection.tsx: renders the card under an Evaluation heading only while the auto-model-routing experiment is on, policy (if enforced) allowstypesafe, andtypesafeis not a legacy custom chat provider (that case already appears under Custom providers). Expand state is shared with the other provider rows.AutoModelRoutingExperimentConfig.tsx: key field, its state, and the legacy-custom detection removed; hint points to Providers; tier id span removed.PROVIDER_DEFINITIONS/ProviderName: it serves no chat models and must not enter model lists or the generic provider rows.Validation
TypeSafeProviderCard.test.tsx: save/clear write shape and draft clearing, missing-key status reason, failed-write error surfacing. The two key-field tests moved out ofAutoModelRoutingExperimentConfig.test.tsx.coder, dev-server-sandbox + agent-browser) against exact head21f9061d8c: PASS, endorsed by an independent runner from the screenshots. Covered: Evaluation group hidden while the experiment is off and shown last when on; collapsed by default with shared expand state; Save via button and Enter, field cleared, "Configured" and green dot, persisted on disk and across reload; Clear restores the no-key state; whitespace-only key keeps Save disabled; 600-char key; two-tab experiment toggle; no key field in the routing panel and its status tracks the key; tier rows show each label once at 1440 and 375 px with add/rename/reorder/model/thinking/remove intact; TypeSafe absent from the composer and tier model pickers. Two minor notes, neither introduced here: the status line shows the backend reason verbatim ("No API key configured for typesafe in providers.jsonc"), and evaluator readiness can be satisfied by ambient env credentials (pre-existing fallback).21f9061d8c, no review threads.src/node/services/taskService.test.ts(lock temp-dir ENOENT race, 0 test failures); rerun passed.Risks
Low. UI-only change in Settings; the write path (
setProviderConfig) and the evaluator credential resolution are unchanged.Generated with
xum• Model:anthropic:claude-fable-5-1• Thinking:xhigh• Cost:$9.69