Repository navigation
Conversation
… layout One Rust file per @ai-sdk/anthropic-aws source file (RFC-0046 §4.2): mod.rs keeps only the module list (index.ts), the settings, factory and provider go to provider.rs (anthropic-aws-provider.ts), and model.rs, which holds the request authentication and the SigV4 transport, becomes fetch.rs (anthropic-aws-fetch.ts). tests/anthropic_aws_settings_test.rs joins src/anthropic_aws/tests/ provider.rs; the two cross-vendor tests (SigV4 signed headers, Bedrock user agents) stay in tests/. Move only: the test count (55) and the test names are unchanged; function bodies change only in module paths. 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.
Anthropic AWS layout refactor:move/rename-only,55 tests 保留,公开 item set 相等;PR 描述写 36 tests,实际 30。Approve。
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
…-aws-tests' into refactor/move-the-anthropic-aws-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
…-aws-tests' into refactor/move-the-anthropic-aws-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
…-aws-tests' into refactor/move-the-anthropic-aws-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
…-aws-tests' into refactor/move-the-anthropic-aws-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
…-aws-tests' into refactor/move-the-anthropic-aws-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
…-aws-tests' into refactor/move-the-anthropic-aws-files-to-the-upstream-layout Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
…-aws-tests' into refactor/move-the-anthropic-aws-files-to-the-upstream-layout Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0116HPMoqaLfFr1TyqDq1hrW
eric8810
changed the base branch from
test/port-the-upstream-anthropic-aws-tests
to
master
October 27, 2026 07:50
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
把 Anthropic AWS 的源文件按
@ai-sdk/anthropic-aws@2.0.63一个文件对一个文件拆开(RFC-0046 §4.2),老的tests/anthropic_aws_settings_test.rs并进厂商测试目录src/anthropic_aws/tests/(RFC-0046 §5 的新布局)。只搬不改:函数体只改了模块路径,测试数量、模块路径和函数名前后一致。叠在测试 PR #319 上。已经测试分支
92dc5baa合上 masterb69137eb,冲突按 master 的改动搬到新位置解决(凭证错误改用AiMuxError::other,文档里的invalid_argument落到provider.rs,老设置测试里的错误模式改成结构体变体,落到tests/provider.rs);测试数前后仍相等(Anthropic AWS 55 个,测试分支 lib 46 个加老测试程序 9 个,名字多重集相同)。一、体系现状(概览,测试 PR #319 头
a60cbae9)上游同一条路:
createAnthropicAws(anthropic-aws-provider.ts)组装设置和模型,createSigV4FetchFunction/createApiKeyFetchFunction(anthropic-aws-fetch.ts)负责鉴权和签名,模型本身来自@ai-sdk/anthropic。aimux 的工厂和index.ts在mod.rs,鉴权和传输在名字叫model.rs的文件里。测试:#319 的新用例在
src/anthropic_aws/tests/,老用例还在独立测试程序tests/anthropic_aws_settings_test.rs(9 个,含修复 PR #314–#318 加的)。tests/sigv4_signed_headers_test.rs和tests/bedrock_user_agent_test.rs同时测 Bedrock、Polly 和 Anthropic AWS,属于跨厂商测试。二、本 PR 改动(细节)
mod.rs模块文档、导出anthropic_aws/mod.rs(只有模块声明和pub use)index.tsmod.rs鉴权枚举、设置、工厂、默认实例、AnthropicAwsProvideranthropic_aws/provider.rs(AnthropicAwsModel类型别名也放这里)anthropic-aws-provider.tsmodel.rsAuth、authenticated、AwsHeaders、两个传输anthropic_aws/fetch.rs(git mv)anthropic-aws-fetch.tsanthropic_aws::{AnthropicAwsAuth, AnthropicAwsModel, AnthropicAwsProvider, AnthropicAwsProviderSettings, anthropic_aws, create_anthropic_aws, TransformRequestBody}由mod.rs再导出;anthropic/config.rs用的Auth、AwsHeaders仍是pub(crate)再导出。model::改成fetch::(Auth、authenticated)。两处文档链接改成全路径。tests/anthropic_aws_settings_test.rs并进src/anthropic_aws/tests/provider.rs末尾,帮手放在「older settings ports」一节,和 test: port the upstream Anthropic AWS tests #319 同名的api_key()改名key_auth();#[path]引入的 mock_fetch 改成crate::test_support::mock_fetch,aimux_providers::改成crate::。tests/fetch.rs的 import 和注释跟着改到fetch.rs。两个跨厂商测试留在tests/。layout.toml的rust字段改到新路径。边界脚本不用改。验证
cargo test -p aimux-providers --lib加原--test anthropic_aws_settings_test:前后都是 55 个测试(46 + 9),模块路径(去掉文件前缀后)和函数名完全相同;55 个全过。按文件:tests/provider.rs30 个、tests/fetch.rs22 个、tests/region_validation.rs3 个。use和注释后,只有上面三处model::→fetch::。cargo +1.99 clippy -p aimux-providers --lib --tests -- -D warnings、cargo doc -D warnings、cargo fmt --check、scripts/check_provider_boundaries.sh通过。Type of change
Checklist
共享进程状态:测试原来各自是单独的测试程序,现在并进 lib 的同一个测试程序。共 36 个测试带
#[serial]:tests/provider.rs全部 30 个(经EnvVar设置 AWS 相关环境变量,结束时恢复)、tests/region_validation.rs3 个(同样设置环境变量)、tests/fetch.rs3 个(改默认传输的路由)。lib 里以后读 AWS 环境变量的测试(Bedrock 搬进来时)也要#[serial]。没有全局计数器和固定临时路径(RFC-0046 §5)。Generated by Claude Code