Skip to content

[v4/p1-prep] chore!: prepare the AI SDK V4 migration - #235

Closed
cunninghamcard-bit wants to merge 10 commits into
masterfrom
v4/p1-prep
Closed

cunninghamcard-bit wants to merge 10 commits into
masterfrom
v4/p1-prep

Conversation

@cunninghamcard-bit

Copy link
Copy Markdown
Contributor

Requested by li

Summary

Before: CI runs only for pull requests into master, so a stacked PR gets no checks. The repo ships a generated ProviderName union, the web console has hand-written wire types, and the shared contract fixtures plus several hand-written tests record Rust's own pre-alignment output rather than real data.

After: CI runs on every pull request and cancels a PR's superseded runs. ProviderName is removed, the web console uses wire types generated with ts-rs, and the self-generated fixtures and tests that pin Rust-only behaviour are deleted. Two of the deleted files come back later in a form that compiles against the new types: PR 6 restores the upstream-translated Anthropic and Bedrock remaining cases, and PR 4 ports upstream's stream timeout tests in place of the old timeout matrix.

This is the first of eight stacked PRs that migrate aimux to the AI SDK V4 types and provider packages. It deletes first, on its own, so the PRs after it show only code changes.

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change
  • New provider
  • New / updated binding
  • Docs / RFC

Checklist

  • cargo fmt --all -- --check passes
  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo test --workspace passes (cassette playback — no network/keys)
  • Added or updated cassette tests / contract fixtures for behavior changes
  • Updated relevant docs (README.md, docs/, rfc/, bindings/README.md)
  • Commit messages follow Conventional Commits

Notes for reviewers

Status: Draft, opened early so the series layout can be reviewed. The items under "Planned in follow-up pushes" land on this branch before it is marked ready. cargo test --workspace has not been run on this branch yet.

Series (each PR targets the one below it; after a merge the next one is retargeted to master):

PR Branch Scope
M v4/m-master-fixes Fixes for the released line (#228), independent of the series
1 v4/p1-prep CI on every PR, ProviderName removal, generated web wire types, delete self-generated fixtures
2 v4/p2-tool-calls Tool-call tracker in provider-utils, V4 tool types
3 v4/p3-messages Messages, content, provider options and prompts as V4 types
4 v4/p4-results Results, stream parts and the call pipeline
5 v4/p5-providers Request layer, provider interface and every vendor as a factory
6 v4/p6-vendors Vendor behaviour aligned with the upstream packages
7 v4/p7-model-kinds Remaining upstream model kinds; Decision as DecisionModelV4
8 v4/p8-public-json Public JSON equals the AI SDK JSON
  • Scope: preparation only; no library behaviour changes apart from the ProviderName removal.
  • Position: base master; next is PR 2.
  • Replaces: part of Draft refactor(core)!: align public core types with the AI SDK V4 shapes #219 (the old stack's A layer).
  • Closes: no issue items.
  • Merged RFC / docs: the alignment doc's merge-strategy group (§9.1, Q3, D31, §0.7, appendix I1, the part-2 implementation order, the §0.5 ts-rs transition, ROADMAP :56-57 and :80) lands here in a follow-up push.
  • Draft RFC: RFC-0036: 补齐 roadmap 全节点设计与验收映射 #207 (merge order of the migration).
  • Size: release artifact sizes before and after are being measured and will be added here.

🤖 Generated with Claude Code

https://claude.ai/code/session_01A3WxDBWBA4ituJjXsHaEAa

🤖 Generated with Claude Code

chenhaonan and others added 10 commits October 11, 2026 16:30
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
(cherry picked from commit 758d0bc)
The returned impl Iterator is already must_use, so clippy's
double_must_use rejected it.

(provider.rs part of commit 8397424)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A3WxDBWBA4ituJjXsHaEAa
…e removal

- scripts/gen_providers_doc.py: the `provider_name` module no longer exists;
  the docstrings and the section-header guard now name only `provider`.
  `--check` output is unchanged.
- docs/internal/phase4-audit.md: add a follow-up note (same style as
  RFC-0020) so the historical audit no longer reads as if the generated
  ProviderName types and their drift tests still exist.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGwanvo9WLU9HWD7sRR8TS
(cherry picked from commit dfcd54f)
The A2 line said Node would keep a generated string-literal union for
completion. It does not: overlay-registered provider names can never be
part of a compile-time union, so keeping one would keep the second name
path this PR removes. Record the actual A2 scope.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGwanvo9WLU9HWD7sRR8TS
(cherry picked from commit 3e2d9fc)
…ia alias

- Wire*.ts were hand-maintained mirrors of wire.rs and had already drifted
  (WireContentPart lacked provider_executed). Derive TS on the wire structs
  and export them to web/src/types/generated/ through gen_ts_types.py, which
  now handles two targets and checks both in CI.
- Core types resolve through the @aimux/types tsconfig alias instead of
  five-level relative paths into bindings/node.
- gen_ts_types.py sync no longer rewrites files that differ only by ts-rs
  end-of-line spaces.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
(cherry picked from commit 69c1351)
- Drop the redundant #[must_use] on provider_names(); the returned
  impl Iterator is already must_use, so clippy::double_must_use failed CI.
- Gate the wire types' ts-rs export tests behind a ts-export feature that
  only gen_ts_types.py enables. A plain cargo test previously wrote
  Wire*.ts into bindings/node/src/types via the workspace-wide
  TS_RS_EXPORT_DIR, which made gen_ts_types.py --check fail on stale files.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
(cherry picked from commit 8397424)
…that pin Rust-only behaviour

The V4 migration that follows replaces these tests with tests ported from
the AI SDK. They are deleted first, on their own, so the PRs after this one
show only code changes. This commit removes only test files (Rust, the seven
bindings, the shared contract fixtures and their Node runner) and the CI
steps that ran the contract fixtures. No library code changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A3WxDBWBA4ituJjXsHaEAa
Pull requests into a branch other than master got no CI, so a stacked PR
could not show it was green against the PR below it. The pull_request
trigger now has no branch filter. A new push to a PR cancels that PR's
run still in progress; pushes to master are never cancelled.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A3WxDBWBA4ituJjXsHaEAa
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.

2 participants