Skip to content

🤖 chore(deps): pin ai 7.0.107 and @ai-sdk openai/anthropic/google for experimental_evaluate - #4319

Open
ThomasK33 wants to merge 2 commits into
mainfrom
thomask33/eval-l1-ai-sdk-upgrade
Open

ThomasK33 wants to merge 2 commits into
mainfrom
thomask33/eval-l1-ai-sdk-upgrade

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Sep 21, 2026

Copy link
Copy Markdown
Member

Summary

Layer L1 (prerequisite) of the workflow evaluate() plan: pin ai 7.0.107, @ai-sdk/openai 4.0.71, @ai-sdk/anthropic 4.0.58, @ai-sdk/google 4.0.76 exactly, and declare @ai-sdk/provider 4.0.17 / @ai-sdk/provider-utils 5.0.45 as direct dependencies. No product code changes. Stack: L1 (this) → L2 evaluation resolver + EvaluationService → L3 workflow evaluate() → L4 Settings/timeline → L5 TypeSafe provider → L6 screening example.

Background

The AI SDK's experimental_evaluate (evaluation models, choice|score|boolean questions) first shipped in ai@7.0.106 with @ai-sdk/openai@4.0.70, @ai-sdk/anthropic@4.0.57, @ai-sdk/google@4.0.75. Xum pinned ai 7.0.19, so later layers cannot import it. Experimental APIs may change in patch releases, hence exact pins (no caret) for the four upgraded packages.

Implementation

  • Only the four packages above move. @ai-sdk/xai stays on 4.x with its existing patch (5.x removed provider.chat, which providerModelFactory.ts uses for non-frontier Grok); bedrock, openai-compatible, deepseek, moonshotai, zai are untouched. No overrides/resolutions.
  • Why @ai-sdk/provider / provider-utils became direct deps: Xum imports spec types from both packages in ~40 files without declaring them, so they resolved to whichever copy Bun hoisted. After the upgrade the hoisted root copy stayed at 4.0.3 (kept by bedrock/deepseek/openai-compatible) while ai/openai/anthropic/google nested 4.0.17, whose JSONValue accepts Readonly<JSONObject> / readonly arrays → 23 tsgo structural mismatches. Declaring the versions ai uses hoists 4.0.17/5.0.45 to the root so Xum's types match the runtime it drives; zero source changes were needed.
  • Duplicate copies in bun.lock (recorded per plan): root @ai-sdk/provider 4.0.17 / provider-utils 5.0.45; nested copies remain for amazon-bedrock, deepseek, openai-compatible (provider 4.0.3 / utils 5.0.7), moonshotai (4.0.3 / 5.0.11), xai (4.0.7 / 5.0.27), zai (4.0.8 / 5.0.33), and ollama-ai-provider-v2 (provider 3.0.10 / utils 4.0.26). Xum's SDK error checks use marker-based isInstance (19 sites, 0 instanceof on SDK error classes), so duplicate copies are not a correctness hazard; this was also probed at runtime (see Validation).
  • flake.nix: the offline-cache fixed-output hash is derived from bun.lock, so it is updated alongside the lockfile (value reported by CI's Flake Hash Check; no local nix here).
  • Runtime note for the next layers: in ai@7.0.107 only experimental_evaluate and Experimental_EvaluationUnsupportedQuestionTypeError are runtime values; the other Experimental_Evaluation* names are type-only exports.

Validation

  • bun install --frozen-lockfile on the committed state; export probe: experimental_evaluate and Experimental_EvaluationUnsupportedQuestionTypeError exported from ai, Experimental_EvaluationMockModelV4 from ai/test, .evaluationModel is a function on createOpenAI / createAnthropic / createGoogleGenerativeAI instances.
  • make static-check green. Mock-routed unit suites (streamManager*, providerModelFactory, tools, gatewayStreamNormalization, common/utils/ai) 2285 pass / 0 fail, identical pass set to main.
  • Fixture-only integration allowlist (tests/ipc files using mockAiRouter / MockLanguageModelV3 / enableMockMode, excluding anything calling validateApiKeys() or reading provider keys): acp.toolRouter, historyFingerprintParity, streaming/queuedMessages.completing, streaming/queuedMessages.starting, streaming/stopAdmission.mock, tasks/persistentSubagentCompaction, config/mcpPrompts, streaming/compactionReplacement.mock — all pass. Real-provider suites (validateApiKeys(), tests/ipc/providers) were not run (no spend authorization).
  • make test-unit: the same 6 deterministic failures + 1 error (taskGitPatchEngine ×2, gitNoHooksEnv ×3, backup/gitRepo ×1, SIGTERM) reproduce on main in isolated reruns — pre-existing, unrelated to the SDK; the remaining differences were load flakes that pass isolated.
  • Remote dogfood UAT (Coder Agents, exact SHA 9bc3b23a6 — the head before the flake-hash-only follow-up commit, which changes no runtime code; labeled prerequisite compatibility check, endorsed PASS by an independent runner): fresh clone + Bun 1.3.5 frozen install, static-check, the suites above; headless dev-server smoke against loopback fixtures with no real provider env — OpenAI Responses wire (function_call_output) and openai-compatible Chat Completions wire (role:"tool") both streamed a tool call + final answer; a fixture 401 surfaced through the nested openai-compatible provider-utils copy into ai@7.0.107 as APICallError 401 (isRetryable:false) with a visible provider error and a successful recovery send; runtime probe of all 7 provider/provider-utils copies: isInstance markers resolve, instanceof does not (as expected). All 101 fixture requests used model=fixture-model; zero external hosts.

Risks

Low. Dependency-only change; chat/tool/streaming paths are exercised by the mock-routed suites and the remote smoke. The main residual risk is provider-specific wire behavior for Anthropic/Google/Bedrock/xAI/zai/DeepSeek/Ollama, which only real-provider suites cover (not run here); those providers keep their own nested SDK copies and were not upgraded.


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

…xperimental_evaluate

Layer L1 of the workflow evaluate() plan: a pure dependency prerequisite,
no product code changes.

- Pin exactly (no caret) ai 7.0.107, @ai-sdk/openai 4.0.71,
  @ai-sdk/anthropic 4.0.58, @ai-sdk/google 4.0.76 — the first releases
  shipping experimental_evaluate / Experimental_Evaluation* / .evaluationModel().
  Experimental APIs may change in patch releases, hence exact pins.
- Declare @ai-sdk/provider 4.0.17 and @ai-sdk/provider-utils 5.0.45 as
  direct dependencies. Xum imports spec types from both packages in ~40
  files but never declared them, so they resolved to whichever copy Bun
  hoisted. After the upgrade the hoisted root copy stayed at 4.0.3 (kept
  by bedrock/deepseek/openai-compatible) while ai/openai/anthropic/google
  nested 4.0.17, and 4.0.17 changed JSONValue to accept Readonly<JSONObject>
  / readonly arrays; tsgo reported 23 structural mismatches at the
  wrapLanguageModel / LanguageModelV4 boundaries. Declaring the packages at
  ai's exact versions hoists 4.0.17/5.0.45 to the root so Xum's types match
  the runtime it drives. Zero source changes were needed.
- Older providers keep their own nested provider copies (bedrock/deepseek/
  openai-compatible/moonshotai 4.0.3, xai 4.0.7, zai 4.0.8). Xum's SDK error
  checks use marker-based isInstance (no instanceof on SDK error classes),
  so duplicate copies are not a correctness hazard. xai stays on 4.x with
  its existing patch.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 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-21T20:02:37.714807Z 66e9816 Manual request
🔒 Security Review Completed 2026-09-21T20:07:32.248824Z 66e9816 Manual request
ℹ️ 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.

…hange

The fixed-output offlineCache derivation hashes bun.lock inputs; CI's Flake Hash Check reported the new hash after the dependency pins.
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 66e9816dbd

ℹ️ 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: 66e9816dbd

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.

@ThomasK33
ThomasK33 added this pull request to stack #4323 September 21, 2026 23:17
@ThomasK33
ThomasK33 removed this pull request from stack #4323 September 22, 2026 05:12
@ThomasK33

Copy link
Copy Markdown
Member Author

Superseded by #4307 (merged to main 2026-09-22 04:03Z), which landed the same ai 7.0.107 / @ai-sdk/openai 4.0.71 / @ai-sdk/anthropic 4.0.58 / @ai-sdk/google 4.0.76 versions this PR pinned (main's lockfile resolves identical top-level versions; the explicit @ai-sdk/provider/@ai-sdk/provider-utils entries are not needed — main already imports @ai-sdk/provider from 48 files without declaring it). This branch now conflicts with main on package.json/bun.lock/flake.nix only.

The rest of the stack was rebased directly onto main and re-linked as stack #4326 (#4321#4322#4324); this PR is no longer part of it. Leaving it open for the owner to close — no further changes planned here.

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