Repository navigation
refactor: move the DeepSeek files to the upstream layout - #300
Merged
eric8810 merged 12 commits intoOct 27, 2026
Merged
Conversation
One Rust file per @ai-sdk/deepseek source file (RFC-0046 §4.2), with upstream's chat/ directory: model.rs becomes chat/chat_language_model.rs, convert.rs chat/convert_to_chat_messages.rs, usage.rs chat/convert_to_usage.rs, types.rs chat/chat_api_types.rs, finish_reason.rs chat/map_finish_reason.rs, and options.rs splits into chat/chat_language_model_options.rs and chat/file_part_options.rs. mod.rs keeps only the module list (index.ts); the provider is in provider.rs. The tests follow: tests/deepseek_chat_test.rs splits by upstream test file into tests/it/deepseek/chat/ (chat_language_model.rs, merged with the snapshot ports, convert_to_chat_messages.rs and prepare_tools.rs) over a shared wiremock harness in support.rs; tests/deepseek_test.rs moves to tests/it/deepseek/replay.rs. Move only: the test count (255), the test function names and their module paths are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
7 of 13 tasks
The test PR now keeps every DeepSeek test in src/deepseek/tests/ (RFC-0046 §5). The renamed source files stay as before under src/deepseek/chat/; the test modules' use paths follow them, and the four chat modules the tests call (convert_to_chat_messages, convert_to_usage, is_v4_model, prepare_tools) are pub(super) in chat/. tests/deepseek_chat_test.rs joins src/deepseek/tests/chat/ by describe block: chat_language_model.rs, convert_to_chat_messages.rs and prepare_tools.rs, its wiremock helpers in support.rs. tests/it/ is gone; the cassette replay stays in tests/deepseek_test.rs. Move only: the 255 tests keep their names and describe paths. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
The test branch now stacks on fix PR #309, which adds two aimux-own tests at the end of tests/deepseek_chat_test.rs. That file is already merged into src/deepseek/tests/chat/, so the two tests land at the end of chat_language_model.rs with the other aimux-own cases. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
This was referenced Oct 20, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
cunninghamcard-bit
marked this pull request as ready for review
October 24, 2026 11:34
eric8810
approved these changes
Oct 25, 2026
eric8810
left a comment
Contributor
There was a problem hiding this comment.
DeepSeek layout refactor:move-only,测试数 1740→1740,公开 API 不变。Approve。
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
Contributor
Author
|
批准之后推了一个只改注释的提交 Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
… is here Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
Contributor
Author
|
按 eric 在 #302 的意见, Generated by Claude Code |
…tests' into refactor/move-the-deepseek-files-to-the-upstream-layout Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
…tests' into refactor/move-the-deepseek-files-to-the-upstream-layout Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
…tests' into refactor/move-the-deepseek-files-to-the-upstream-layout Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
…tests' into refactor/move-the-deepseek-files-to-the-upstream-layout Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
…tests' into refactor/move-the-deepseek-files-to-the-upstream-layout Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
eric8810
approved these changes
Oct 27, 2026
eric8810
left a comment
Contributor
There was a problem hiding this comment.
Verified the post-approval commits on this head: only additive tests/docs or tightened boundary checks; no weakening or behavior regression. Re-approving the current head.
eric8810
changed the base branch from
test/port-the-upstream-deepseek-tests
to
master
October 27, 2026 01:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
按 RFC-0046 §4.2、§5(#294)把 DeepSeek 的文件按
@ai-sdk/deepseek逐个对应,做法和 Mistral(#297)、Cohere(#298)、Hugging Face(#304)相同。叠在 #299(DeepSeek 测试迁移)上。只挪不改:没有改任何函数体和断言,测试数前后都是 257,测试函数名和 describe 路径完全一致。测试位置按 10-20 定的新布局:DeepSeek 的测试全部在
src/deepseek/tests/,一个上游测试文件对应一个同名 Rust 文件,不再有foo/tests.rs和tests/it/。已经测试分支
26e6e755合上 masterb69137eb,冲突按 master 的改动搬到新位置解决(错误改成 RFC-0047 的构造函数和结构体变体,落到chat/chat_language_model_options.rs、provider.rs和tests/chat/chat_language_model.rs);测试数前后仍相等(DeepSeek 119 个,lib 118 个加留在tests/的 1 个,名字多重集相同)。一、体系概览:一次 DeepSeek 调用经过哪些文件(#299 head
f7d20a2b)DeepSeek 原来就基本一个上游文件一个 Rust 文件,差别在三处:上游的模型代码都在
src/chat/子目录,aimux 平铺;options.rs装了两个上游文件;mod.rs既是index.ts又是 provider。测试:#299 的 23 个在src/deepseek/tests/chat/,另有 2 个独立测试程序tests/deepseek_chat_test.rs(95 个,wiremock,含修复 PR #309 加的 2 个)和tests/deepseek_test.rs(cassette 回放 4 个)。二、本 PR 的改动(细节)
1. 源文件:照上游建
chat/子目录,去掉和目录重复的厂商前缀file_part_options.rs用的两个解析小函数parse_namespace、invalid留在chat_language_model_options.rs,改成pub(super)。测试直接调用的四个模块(convert_to_chat_messages、convert_to_usage、is_v4_model、prepare_tools)在chat/mod.rs里是pub(super) mod,让deepseek::tests看得到。layout.toml的rust字段同步改成新文件名。2. 测试:全部在
src/deepseek/tests/chat/,和上游src/chat/*.test.ts同名合并
chat_language_model.rs时,#299 文件里有 5 个帮手函数和 support.rs 重名(options、weather_tool、tool_options、json_options、stream_parts),给它们加了fixture_前缀;测试函数本身不变。Type of change
Checklist
cargo fmt --all -- --checkpassescargo +1.99 clippy -p aimux-providers --lib --tests -- -D warnings、cargo doc -D warningspassdeepseek_test4 个、non_object_tool_input_test全过scripts/check_provider_boundaries.shpassesNotes for reviewers
DeepSeekChatLanguageModel、create_deepseek等照旧从aimux_providers::deepseek导出,原来的子模块本来就是私有的。tests/non_object_tool_input_test.rs注释里引用的旧路径deepseek/convert.rs:286改成deepseek/chat/convert_to_chat_messages.rs:287。*_language_model_options.rs写命名空间键。共享进程状态:测试原来各自是单独的测试程序,现在并进 lib 的同一个测试程序。本家的测试不改环境变量,不用全局计数器和固定临时路径,搬进来不受别家影响(RFC-0046 §5)。
https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
Generated by Claude Code