Skip to content

🤖 feat(workflows): TypeSafe evaluation provider for evaluate() - #4332

Open
ThomasK33 wants to merge 2 commits into
thomask33/eval-l4-settings-timelinefrom
thomask33/eval-l5-typesafe-provider
Open

ThomasK33 wants to merge 2 commits into
thomask33/eval-l4-settings-timelinefrom
thomask33/eval-l5-typesafe-provider

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Summary

Fifth layer of the workflow evaluate() primitive (stacked on #4330): the evaluation resolver, CLI and wire path learn the reserved evaluation-only typesafe credential key that main already ships for auto model routing, so an evaluate() step can run on TypeSafe AI with a TypeSafe-only configuration. No new PROVIDER_DEFINITIONS entry and no chat-picker exposure.

Background

Plan layers: L2a #4321 → L2b #4322 → L3a #4324 → L3b #4329 (runner + CLI) → L4 #4330 (timeline rendering) → L5 (this PR) → L6 example + docs. typesafe is not a ProviderName: it is the credential key auto model routing uses for its evaluation model (DEFAULT_AUTO_MODEL_ROUTING_EVALUATION_MODEL), which is exactly what evaluate() needs.

Implementation

  • EVALUATION_PROVIDERS gains typesafe (typed as ProviderName | typeof TYPESAFE_PROVIDER_KEY); isEvaluationEligibleModelString accepts typesafe:<id>.
  • resolveTypeSafeCredentials (shared with auto model routing, providerRequirements.ts) reads the typesafe providers entry or TYPESAFE_API_KEY_ENV_VARS; createEvaluationModel gets a createTypeSafeAi branch. The pinned selection's routeKind is direct, and the route comparison is done as strings because resolveRoute returns the key through an unchecked cast.
  • CLI: the ephemeral run config's providers copy keeps evaluation-only entries (previously only chat ProviderNames were copied), so xum workflow run --evaluation-model typesafe:jev-latest works with only a TypeSafe key configured.
  • Offering typesafe:jev-latest in the Settings evaluation card moves with the card to its own PR (see 🤖 feat(workflows): evaluate() step rendering in the workflow timeline and tool card #4330's scope note).

Validation

  • providerModelFactory.test.ts (+3): typesafe: resolves on the direct route from the providers entry and from the env var; missing key → unauthorized; a chat model string is unaffected.
  • evaluationModels.test.ts: eligibility of typesafe:<id> and rejection of other non-ProviderName prefixes.
  • src/cli/workflow.test.ts (+1): a TypeSafe-only run config reaches evaluate() (red → green: before the copy fix the run failed unsupported-provider).
  • tests/ipc/workflows/evaluateWire.test.ts (TEST_INTEGRATION=1, +2 lanes): real @ai-sdk/typesafe-ai adapter against the loopback fixture through ORPC — booleans travel as noul, rounded distributions validate, confidence never reaches the result; a 401 is a provider failure and an interrupted hang aborts the request.
  • make static-check green.

Risks

  • Additive: only typesafe:-prefixed model strings take the new branch; chat providers and routing are untouched. Secrets: the key is read through the same credential resolver auto model routing already uses; nothing new is persisted.

Generated with xum • Model: coder:anthropic/claude-fable-5-1 • Thinking: xhigh • Cost: $511.72

@ThomasK33
ThomasK33 added this pull request to stack #4326 September 22, 2026 14:50
@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-22T20:07:43.903742Z d92d312 New commits
🔒 Security Review Completed 2026-09-22T20:11:12.117826Z d92d312 New commits
ℹ️ 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 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: dd0603bcc7

ℹ️ 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/node/services/providerModelFactory.ts Outdated
ThomasK33 added a commit that referenced this pull request Sep 22, 2026
Codex round 1 on #4332: the TypeSafe construction branch passed the raw
configured base URL to the SDK, so a hand-edited entry with surrounding
whitespace produced `https://proxy/v1 /systemone`. The credential resolver
already reads the (policy-forced or configured) URL trimmed — the same value
auto model routing's evaluator uses — so the branch now uses that. Test: the
whitespace-padded entry sends to the trimmed URL.

_Generated with `xum` • Model: `coder:anthropic/claude-fable-5-1` • Thinking: `xhigh` • Cost: `$523.02`_

<!-- mux-attribution: model=coder:anthropic/claude-fable-5-1 thinking=xhigh costs=523.02 -->
Teach the workflow evaluate() resolver the reserved evaluation-only
`typesafe` key that main already ships for auto model routing (no new
PROVIDER_DEFINITIONS entry): shared resolveTypeSafeCredentials, a
createTypeSafeAi construction branch, and the CLI's run-scoped providers copy
keeps evaluation-only entries so a TypeSafe-only configuration reaches
evaluate(). Offering `typesafe:jev-latest` in the Settings evaluation card
moves with the card to its own PR (#4330 was reduced to timeline rendering).

_Generated with `xum` • Model: `coder:anthropic/claude-fable-5-1` • Thinking: `xhigh` • Cost: `$511.72`_

<!-- mux-attribution: model=coder:anthropic/claude-fable-5-1 thinking=xhigh costs=511.72 -->
Codex round 1 on #4332: the TypeSafe construction branch passed the raw
configured base URL to the SDK, so a hand-edited entry with surrounding
whitespace produced `https://proxy/v1 /systemone`. The credential resolver
already reads the (policy-forced or configured) URL trimmed — the same value
auto model routing's evaluator uses — so the branch now uses that. Test: the
whitespace-padded entry sends to the trimmed URL.

_Generated with `xum` • Model: `coder:anthropic/claude-fable-5-1` • Thinking: `xhigh` • Cost: `$523.02`_

<!-- mux-attribution: model=coder:anthropic/claude-fable-5-1 thinking=xhigh costs=523.02 -->
@ThomasK33
ThomasK33 force-pushed the thomask33/eval-l5-typesafe-provider branch from 4864078 to d92d312 Compare September 22, 2026 20:02

This branch has not been deployed

No deployments
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