Skip to content

🤖 fix: move the TypeSafe key to Providers settings and drop the duplicate tier id - #4331

Merged
ibetitsmike merged 1 commit into
mainfrom
mike/typesafe-provider-settings
Sep 22, 2026
Merged

ibetitsmike merged 1 commit into
mainfrom
mike/typesafe-provider-settings

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

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.apiKey into 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 from getAutoModelRoutingEvaluationStatus for the default typesafe:jev-latest evaluator). Writes through the existing providers.setProviderConfig.
  • ProvidersSection.tsx: renders the card under an Evaluation heading only while the auto-model-routing experiment is on, policy (if enforced) allows typesafe, and typesafe is 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.
  • TypeSafe intentionally stays out of 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 of AutoModelRoutingExperimentConfig.test.tsx.
  • Remote dogfood UAT (Coder Agents, template coder, dev-server-sandbox + agent-browser) against exact head 21f9061d8c: 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).
  • Codex code review and security review: clean on 21f9061d8c, no review threads.
  • CI: Test / Unit attempt 1 hit an unrelated "unhandled error between tests" in 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

…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.
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-22T14:43:19.578365Z 21f9061 Draft marked ready
🔒 Security Review Completed 2026-09-22T14:41:31.296426Z 21f9061 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 21f9061d8c

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ibetitsmike
ibetitsmike marked this pull request as ready for review September 22, 2026 14:32
@ibetitsmike
ibetitsmike added this pull request to the merge queue Sep 22, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/browser/features/Settings/Sections/TypeSafeProviderCard.tsx
Comment thread src/browser/features/Settings/Sections/TypeSafeProviderCard.tsx
Merged via the queue into main with commit 6bd7d22 Sep 22, 2026
35 of 38 checks passed
@ibetitsmike
ibetitsmike deleted the mike/typesafe-provider-settings branch September 22, 2026 14:54
yermakoffivan pushed a commit to yermakoffivan/mux that referenced this pull request Sep 22, 2026
…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 -->
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