Skip to content

test: port the upstream Anthropic tests - #361

Merged
eric8810 merged 39 commits into
masterfrom
test/port-the-upstream-anthropic-tests
Oct 27, 2026
Merged

eric8810 merged 39 commits into
masterfrom
test/port-the-upstream-anthropic-tests

Conversation

@cunninghamcard-bit

@cunninghamcard-bit cunninghamcard-bit commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

按 RFC-0045(#281)把 @ai-sdk/anthropic@4.0.71 的上游测试迁完,按厂商分批的第十三个(Mistral #295、Cohere #296、DeepSeek #299、Groq #301、Hugging Face #303、xAI #312、Anthropic AWS #319、Azure #324、Open Responses #347、Google Vertex #352、OpenAI-compatible #355、Amazon Bedrock #358)。

上游 15 个测试文件共 614 个用例:

  • 533 个新写了测试并通过,放在 src/anthropic/tests/,一个上游测试文件对应一个 Rust 文件。
  • 29 个由原有的旧测试完整覆盖,旧测试挪进按 describe 链命名的 mod,加上 /// upstream: 标记,函数名和函数体不变;另有 22 处旧测试只覆盖了一部分,加了 /// partial: … 指向完整用例。这部分单独一个提交。
  • 52 个写进 layout.toml:
    • anthropic-batch.ts(Message Batches API,38 个)和 tool/*.ts 的工具工厂(bash_20241022、bash_20250124 各 1 个)aimux 没有,文件条目是 missing,挂 Provider 构造与配置:迁移后遗留缺口 #275,用例不迁。
    • 10 个 sub-feature(Provider 构造与配置:迁移后遗留缺口 #275):web_fetch / web_search 工具没有输出 schema(8 个),文件上传没有逐次调用的 headers(1 个),aimux-core 没有 NoSuchProviderReference 错误类型(1 个)。
    • 2 个 ts-only:anthropicErrorDataSchema 是导出的 zod schema;往 uploadFile 传 ReadableStream 是 JS 运行时检查,Rust 类型表达不了。

迁移中发现 12 处行为差异,修在 #360 里,一处一个提交,各带一个在 master 上失败的测试;#360 还带上了 #354 的共用 SSE 解析修复(Anthropic 的流式用例也用到)。#360 已合入 master:

提交 差异
8a66e7f4 历史里来源 code execution 调用已被裁掉的 caller 去掉并警告
45440e7b 发不回去的 provider 执行工具结果,警告里写明输出类型
d231d61c 回放 MCP 工具结果时给出上游的警告
1d933c42 服务端 fallback 块保留成 anthropic.fallback custom part,并能发回去
13da917a 没有 citations 的 web_fetch 结果不再带 "citations": null
a152cdd1 safeguards 选项连同 beta 一起发出去(之前校验后丢掉)
95d14ebb 认得 Vertex 的 claude-sonnet-4@…、claude-opus-4@… 模型 id
c5943d44 anthropic-beta 按上游的插入顺序拼,不再排序
7c45448a 流式 code execution 工具输入保留原始流文本
1751a69f 流在 message_stop 之后继续读后面的 message
7f4a253d message_start 里自带的 tool_use 块也流出来
df932bba 首个 chunk 就报错时,responseBody 是错误数据本身
e94beeae 流里事件不是 JSON 时报上游的 JSON parsing failed: …(与 #354 同一改动)

一、体系概览:Anthropic 的测试现在怎么跑(master 24977c43)

cargo test -p aimux-providers
  ├─ unittests src/lib.rs                       anthropic 5 个(stream.rs、tool_name_mapping.rs 里的 #[cfg(test)])
  └─ tests/*.rs
       ├─ anthropic_remaining_test.rs              21 个   provider 配置、未知模型 max_tokens、sanitize、中途换工具
       ├─ anthropic_files_test.rs                  12 个
       ├─ anthropic_factory_test.rs                 7 个   回放 fixtures/aisdk/anthropic 的录制
       ├─ anthropic_toolset_test.rs                 7 个
       ├─ anthropic_upstream_e2e_test.rs            6 个
       ├─ anthropic_provider_tool_args_test.rs      5 个
       └─ anthropic_evaluation_test.rs              3 个
            create_anthropic(AnthropicProviderSettings { .. })        anthropic/mod.rs:169
            └ AnthropicProvider                                      :237   impl Provider :317
              ├ messages / chat → AnthropicMessagesModel             model.rs:38   impl LanguageModel :138(do_generate :152、do_stream :168)
              │   ├ build_request_body_for                           convert.rs:2815
              │   │   ├ convert_prompt_with_validator                convert.rs:133
              │   │   ├ prepare_tools_with_validator                 prepare_tools.rs:154
              │   │   └ get_model_capabilities                       convert.rs:1674
              │   ├ anthropic_generate_core → parse_anthropic_content    stream.rs:1034 / :677
              │   ├ anthropic_stream_core                            stream.rs:1148
              │   └ convert_anthropic_usage                          usage.rs:82
              ├ files → AnthropicFiles                               files.rs:59
              └ skills → AnthropicSkills                             skills.rs:41
            错误:anthropic_failed_response_handler                    mod.rs:55

上游 packages/anthropic/src/ 的 15 个测试文件(用例数):

anthropic-language-model.test.ts                     341
convert-to-anthropic-prompt.test.ts                  101
anthropic-prepare-tools.test.ts                       66
anthropic-batch.test.ts                               38   aimux 没有 Message Batches API
convert-anthropic-usage.test.ts                       15
anthropic-files.test.ts                               14
anthropic-provider.test.ts                            12
anthropic-evaluation.test.ts                           7
skills/anthropic-skills.test.ts                        7
sanitize-json-schema.test.ts                           5
anthropic-unknown-model-max-output-tokens.test.ts      3
anthropic-message-lifecycle.test.ts                    2
anthropic-error.test.ts                                1
tool/bash_20241022.test.ts                             1
tool/bash_20250124.test.ts                             1

二、本 PR 的改动(细节)

1. 新测试目录(anthropic/mod.rs 末尾 #[cfg(test)] mod tests;,:413)

cargo test -p aimux-providers --lib anthropic::tests::          533 个
  src/anthropic/tests/mod.rs           每个有新测试的上游测试文件一个 mod
  language_model.rs                338   mod anthropic_language_model { do_generate(185)/ do_stream / custom_provider_name_support / … }
                                         另有 get_model_capabilities、effort_with_thinking_disabled、claude_*_specific_behavior、computer_toolset、mid_conversation_tool_changes 等顶层 describe
  convert_to_prompt.rs             101   convert_prompt_to_anthropic_full_with_tools,上游的 V4 prompt JSON 反序列化成 LanguageModelPrompt
  prepare_tools.rs                  58   prepare_tools_with_provider / prepare_tools_with_validator;rejectsForcedToolUse 经 build_request_body_with_warnings
  convert_usage.rs                  15   convert_anthropic_usage
  evaluation.rs                      7   decision_model 走 Messages API
  skills/skills.rs                   7   AnthropicSkills::upload_skill
  files.rs                           4   AnthropicFiles::upload_file
  message_lifecycle.rs               2
  provider.rs                        1
  fixtures/(64 个)、skills/fixtures/(2 个)   上游 __fixtures__ 原样拷贝
  snapshots/(27 个)                    上游 toMatchSnapshot 转成 JSON
  src/test_support/mod.rs                #[path = "../../tests/common/mock_fetch.rs"] mod mock_fetch;   lib.rs 末尾 #[cfg(test)] mod test_support;(:408)
可见性                                   convert.rs:1781 的 ModelCapabilities(含字段)和 :1828 的 get_model_capabilities 改成 pub(super)
scripts/check_provider_boundaries.sh     规则 7c、8b 的 find 跳过 */tests/*;规则 6b 跳过注释行(标记里引用的上游用例名带 "anthropic")

2. 这些测试动到的进程级状态

新测试编进 aimux-providers 的 lib 测试二进制,和其他模块的单元测试同进程并行跑。它们不读也不改环境变量,没有 #[serial],不换进程默认 transport,没有全局计数器,不写临时文件;每个测试用自己的 MockFetch,需要 URL 的都显式传 base_url。挪进 mod 的旧 baseURL 用例仍在 anthropic_remaining_test.rs 自己的二进制里,照旧 #[serial] 改 ANTHROPIC_BASE_URL 并恢复。

3. aimux-providers/layout.toml(只加 [anthropic],44 个上游源文件)

19 个 mapped 到 anthropic/*.rs
anthropic-batch.ts、anthropic-tools.ts、tool/*.ts(23 个)   missing,issue 275
forward-anthropic-container-id-from-last-step.ts            not-applicable:多步 prepareStep 的辅助函数,core 是单步(对齐文档 Q1)
version.ts                                                   not-applicable
anthropic-prepare-tools.ts     sub-feature 8(web_fetch / web_search 输出 schema)
anthropic-files.ts             sub-feature 1(逐次调用的 headers),ts-only 1(ReadableStream)
anthropic-language-model.ts    sub-feature 1(NoSuchProviderReference)
anthropic-error.ts             ts-only 1(zod schema)

anthropic-message-lifecycle.test.ts 和 anthropic-unknown-model-max-output-tokens.test.ts 没有同名源文件,用例全迁了,不需要写排除。

4. 旧测试的标记(单独一个提交,函数名和函数体不变)

tests/anthropic_remaining_test.rs     20 个挪进 mod 加 /// upstream:(baseURL、鉴权、custom name、supportedUrls、未知模型、sanitize、中途换工具),1 处 /// partial:
tests/anthropic_files_test.rs          8 个挪进 mod anthropic_files::upload_file 加 /// upstream:,4 处 /// partial:
tests/anthropic_upstream_e2e_test.rs   1 个挪进 mod 加 /// upstream:,4 处 /// partial:(换掉原来的 /// TS: 行)
tests/anthropic_toolset_test.rs        6 处 /// partial:
tests/anthropic_factory_test.rs        3 处 /// partial:
tests/anthropic_evaluation_test.rs、anthropic_provider_tool_args_test.rs   各 1 处 /// partial:
src/anthropic/stream.rs                2 处 /// partial:

harness 上的差别(期望值都没改,除了下面写明的比法):

  • 上游直接 new AnthropicMessagesLanguageModel(...);这里用 create_anthropic 加 api_key、base_url、fetch 建,generateId 能注入的地方用 provider 设置注入。
  • 请求体按 JS 读 JSON 的方式比(10.0 等于 10);mock 响应带上测试服务器的 content-length。
  • 流里的错误 part 按上游形状比(type、message、statusCode、isRetryable、data)。ApiCallError::is_retryable 是 bool:上游对推不出元数据的错误类型 statusCode、isRetryable 都是 undefined,aimux 是没有状态码和 false,两者按相等处理。
  • 坏 JSON 的报错只比 \nError message: 之前的部分,后面是 JS 运行时 JSON.parse 自己的文字。
  • convert-to-anthropic-prompt 用 toEqual(new Set(...)) 比 betas,与顺序无关,两边都排序再比;anthropic-prepare-tools 的 inline snapshot 按插入顺序打印,按顺序比。
  • toolsetNames: { X: 'computer' } 在 aimux 里由调用的工具推出来,改成传一个叫 X 的 computer_toolset_20260801 工具。
  • UnsupportedFunctionality、InvalidArgument 只带一个字符串,上游的 argument: 'providerOptions' 等字段查不了,只比错误类型和消息。
  • 上游整个文件共用一个 mockId 计数器,web search fixture 快照里的 id 从 id-14 开始,这个用例的生成器也从 14 起。
  • user agent 钉住的是 ai-sdk-anthropic/4.0.71 ai-sdk-provider-utils/5.0.53(上游 mock 成 0.0.0-test),单独比。快照里值为 undefined 的键在 JSON 里省略。
  • 提供方键名都写成 crate::anthropic::options::CANONICAL(边界规则 6b 不许源码里出现 "anthropic" 字面量)。

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change
  • New provider
  • New / updated binding
  • Docs / RFC
  • Tests(上游测试迁移)

Checklist

  • cargo +1.99 fmt --all -- --check passes
  • cargo +1.99 clippy -p aimux-providers -p aimux-provider-utils -p aimux-ops --lib --tests --all-features -- -D warnings passes
  • cargo +1.99 test -p aimux-providers -p aimux-provider-utils -p aimux-ops --all-features:167 个测试二进制,3373 个测试通过(比 fix: Anthropic prompts, betas, safeguards and streams match the AI SDK #360 多 533 个)
  • scripts/check_provider_boundaries.sh passes
  • Commit messages follow Conventional Commits

Notes for reviewers


Generated by Claude Code

cunninghamcard-bit and others added 15 commits October 20, 2026 19:10
@ai-sdk/anthropic 4.0.71 drops the caller of assistant blocks before the
last user message whose source code execution server_tool_use is not among
the emitted blocks, warning once per tool call
(convert-to-anthropic-prompt.ts:1463-1510). aimux sent the caller as is.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
@ai-sdk/anthropic 4.0.71 warns `provider executed tool result output type
<type> for tool <name> is not supported` for the MCP, code execution, web
fetch/search, tool search and advisor results it cannot send back
(convert-to-anthropic-prompt.ts:1029-1032, 1380-1383), and `provider executed
tool result for tool <name> is not supported` for any other tool
(:1435-1438). aimux left out the type and used the former for unknown tools.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
@ai-sdk/anthropic 4.0.71 pushes the mcp_tool_result block without breaking
out of the tool-result case, so it falls through to the `provider executed
tool result for tool <name> is not supported` warning
(convert-to-anthropic-prompt.ts:1025-1046, 1435-1438). aimux sent the block
without the warning.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
@ai-sdk/anthropic 4.0.71 turns a response `fallback` block into a custom
`anthropic.fallback` part in doGenerate and doStream
(anthropic-language-model.ts:1724-1737, 1976-1989) and converts that part
back into a `fallback` block, a thinking-order boundary, warning on invalid
metadata (convert-to-anthropic-prompt.ts:829-853, 1600-1606). aimux sent the
`fallbacks` option but dropped the block on both sides.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
@ai-sdk/anthropic 4.0.71 copies `content.citations` through as is
(anthropic-language-model.ts:1508, :2289; schema anthropic-api.ts:866 makes
it optional), so a document without citations has no key, and the prompt
converter (convert-to-anthropic-prompt.ts:1266) drops it via JSON.stringify.
aimux wrote `"citations": null` in both places.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
@ai-sdk/anthropic 4.0.71 maps `providerOptions.anthropic.safeguards` to the
body's `safeguards` (`classifierContext` -> `classifier_context`,
anthropic-language-model.ts:812-820) and adds `dangerous-tool-use-2026-09-03`
(:970-975). aimux validated the option but left it out of the request.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
@ai-sdk/anthropic 4.0.71 matches `/claude-sonnet-4(?:-|@)/` and
`/claude-opus-4(?:-|@)/` (anthropic-language-model.ts:3311, :3324), so the
Vertex id `claude-sonnet-4@20250514` is known with 64000 max output tokens.
aimux matched only `claude-sonnet-4-` / `claude-opus-4-` and treated the
`@` ids as unknown (128000 max tokens plus a warning).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
@ai-sdk/anthropic 4.0.71 keeps the betas in a Set and joins it as built
(anthropic-language-model.ts:1082-1087, :1118): prompt betas, the option
betas in the order of :963-1037, tool betas, header betas (config, then
request, :1122-1140), then `anthropicBeta`. aimux kept a BTreeSet, so the
header came out sorted.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
@ai-sdk/anthropic 4.0.71 emits a streamed provider tool call's input as
the accumulated delta text, only re-stringifying a code_execution
`{ code }` input that lacks a `type` (anthropic-language-model.ts:2638-2657).
aimux parsed every code_execution input and re-serialized it compactly.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
@ai-sdk/anthropic 4.0.71 has no flush: every `message_stop` enqueues its
finish and the stream keeps reading, so a later `message_start` opens the
next message (anthropic-language-model.ts:2849-2877, :3031-3087), and the
usage accumulator only takes the input side from `message_start`. aimux
terminated the stream at the first `message_stop`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
@ai-sdk/anthropic 4.0.71 reads `message.content` of `message_start` and
emits each `tool_use` block there (deferred programmatic tool calls) as
tool-input-start/delta/end plus a tool-call with its caller metadata
(anthropic-language-model.ts:2905-2955). aimux ignored that content.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
@ai-sdk/anthropic 4.0.71 throws a first-chunk error as an APICallError
with `responseBody: JSON.stringify(error.data)` and `statusCode:
error.statusCode ?? 500` (anthropic-language-model.ts:3150-3160). aimux
used the whole `{"type":"error","error":…}` frame as the body and left an
unmapped type without a status; the upstream e2e test now expects the 500.

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

A streamed SSE event whose data is not JSON yielded `JsonParse` with only
the parser's message. The AI SDK's `parseJsonEventStream` reads each event
with `safeParseJSON`, whose `JSONParseError` reads
`JSON parsing failed: Text: <text>.\nError message: <message>`
(`@ai-sdk/provider` src/errors/json-parse-error.ts:16-19). Found while
porting the `@ai-sdk/openai-compatible` 3.0.62 tests (`doStream › should
handle unparsable stream parts`, chat and completion); every stream read
through `create_event_source_response_handler` now reports it the same way.
Well-formed JSON of the wrong shape stays `InvalidResponseData`.

Same change as #354 (the OpenAI-compatible fix PR): the Anthropic stream
port hits it too (`doStream › code execution 20250825 tool › should include
file id list in code execution tool call result`). It is a no-op once #354
is merged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
Ports the tests of @ai-sdk/anthropic 4.0.71 (RFC-0045) into
aimux-providers/src/anthropic/tests/, one Rust file per upstream test file,
one mod per describe level and an `/// upstream:` marker on every test:
533 new tests. With the 29 old tests marked in the next commit, 562 of the
614 upstream cases have a test. aimux-providers/layout.toml (`[anthropic]`)
lists the other 52: anthropic-batch.ts and the tool/*.ts factories are
missing (#275), so their 40 cases are not ported; 10 cases are sub-feature
(#275: no web_fetch / web_search output schemas, no per-call file upload
headers, no NoSuchProviderReference error kind) and 2 ts-only.

Upstream fixtures are copied unchanged into fixtures/ and skills/fixtures/,
the `toMatchSnapshot` values become snapshots/*.json. `get_model_capabilities`
and `ModelCapabilities` are widened to `pub(super)` for the tests. Boundary
rule 6b now skips comment lines, so a marker may quote an upstream test name
that contains "anthropic". The new tests touch no environment variable and
no process-wide state.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
29 old tests that assert everything an upstream @ai-sdk/anthropic 4.0.71
case asserts get its `/// upstream:` marker and move into mods named after
its describe chain; their names and bodies are unchanged. 22 `/// partial:`
lines point the old tests that cover a case only in part at the full port
in src/anthropic/tests/. Old `/// TS:` lines that the markers replace are
removed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
cunninghamcard-bit and others added 3 commits October 24, 2026 09:12
11 ported tests built the provider without `base_url`, so it read
`ANTHROPIC_BASE_URL` when created. The lib test binary also runs
`default_providers::an_invalid_env_base_url_fails_each_call_not_creation`,
which sets that variable to "not a url" for a moment, so under parallel
threads those tests could pick it up. They now pass
`https://api.anthropic.com/v1`, the default they already expect.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
…match-the-ai-sdk

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
…-sdk into test/port-the-upstream-anthropic-tests

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
@cunninghamcard-bit
cunninghamcard-bit marked this pull request as ready for review October 24, 2026 11:31
…match-the-ai-sdk

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

@eric8810 eric8810 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anthropic test port:533 tests/614 upstream cases accounted,fixtures/snapshots 非空且无 skip;在 #360 rebase 后 restack。Approve。

cunninghamcard-bit and others added 3 commits October 25, 2026 08:38
@ai-sdk/anthropic 4.0.71 parses an error chunk with `code`, `statusCode`
and `isRetryable` as `nullish()` (anthropic-api.ts:1450-1459), so a field
sent as `null` stays on the parsed error, and createAnthropicStreamError
uses that parsed error as the data when the frame has none (`data: 'data'
in error ? error.data : error`, anthropic-language-model.ts:91); a
first-chunk error is thrown with `responseBody: JSON.stringify(error.data)`
(:3135-3139). aimux read the three fields as plain options, so a `null`
was dropped from that data and from the response body. They are now
presence-aware; a `null` status or retry flag still falls back to the
type's (:89-90).

StreamErrorData::is_retryable becomes Option<Option<bool>> (CHANGELOG
Breaking).

Test: first_chunk_stream_error_keeps_explicit_null_fields
(tests/anthropic_remaining_test.rs) fails without the change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
…guards-and-streams-match-the-ai-sdk' into test/port-the-upstream-anthropic-tests
…through warning

Upstream's MCP branch in convertToAnthropicPrompt has no break, so an MCP
tool named web_search falls into `if (providerToolName === 'web_search')`
(convert-to-anthropic-prompt.ts:1284-1336), which breaks before the
unsupported-result warning at :1435-1438. The test pins that: the
mcp_tool_result block is sent and no warning is raised.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
cunninghamcard-bit and others added 4 commits October 25, 2026 11:25
…guards-and-streams-match-the-ai-sdk' into test/port-the-upstream-anthropic-tests

# Conflicts:
#	aimux-providers/layout.toml
Upstream's MCP branch in the assistant tool-result conversion has no
`break`, so after the `mcp_tool_result` the result goes through the
per-tool checks: a provider tool name adds its typed result block, tool
search warns about an `error-json` result, and any other name ends at the
unsupported-result warning. The guard skipped the whole per-tool step for
provider tool names; this follows upstream by output type instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoxcKU4zBD64Lri3e4Lrq5
…ts-betas-safeguards-and-streams-match-the-ai-sdk
…h-the-ai-sdk' into test/port-the-upstream-anthropic-tests

# Conflicts:
#	aimux-providers/layout.toml
@cunninghamcard-bit
cunninghamcard-bit changed the base branch from fix/anthropic-prompts-betas-safeguards-and-streams-match-the-ai-sdk to master October 25, 2026 17:22
cunninghamcard-bit and others added 3 commits October 25, 2026 17:23
…eam-anthropic-tests

# Conflicts:
#	aimux-providers/layout.toml
#	aimux-providers/tests/anthropic_remaining_test.rs
…eam-anthropic-tests

# Conflicts:
#	aimux-providers/layout.toml

@eric8810 eric8810 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

…eam-anthropic-tests

# Conflicts:
#	aimux-providers/layout.toml

@eric8810 eric8810 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase is content-preserving: only master/parent merges and CHANGELOG/layout conflict resolution; tests and CI unchanged. Re-approving current head.

…eam-anthropic-tests

# Conflicts:
#	aimux-providers/layout.toml

@eric8810 eric8810 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase verified content-preserving: only master/parent merges and CHANGELOG/layout conflict resolution; CI 16/16. Re-approving current head.

…eam-anthropic-tests

# Conflicts:
#	aimux-providers/layout.toml

@eric8810 eric8810 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase verified content-preserving: only master/parent merges and conflict resolution; CI 16/16. Re-approving current head.

…eam-anthropic-tests

# Conflicts:
#	aimux-providers/layout.toml

Copy link
Copy Markdown
Contributor Author

Flutter example (android) failed on 23b089f before any build step ran: the Android SDK manager cut off the NDK r28c download (Premature EOF while preparing NDK 28.2.13676358), so Gradle could not configure :app. This PR only changes Rust tests under aimux-providers and doesn't touch the Flutter binding or the Android toolchain, so the failure isn't from this PR. I've re-run the failed jobs once.


Generated by Claude Code


Generated by Claude Code

@cunninghamcard-bit cunninghamcard-bit mentioned this pull request Oct 27, 2026
6 of 12 tasks

@eric8810 eric8810 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase verified content-preserving: only master/parent merges and conflict resolution; CI 16/16. Re-approving current head.

…eam-anthropic-tests

# Conflicts:
#	aimux-providers/layout.toml

@eric8810 eric8810 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase verified content-preserving: only master merges and conflict resolution; CI 16/16. Re-approving current head.

…eam-anthropic-tests

# Conflicts:
#	aimux-providers/layout.toml

@eric8810 eric8810 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase verified content-preserving: only master merges and conflict resolution; CI 16/16. Re-approving current head.

…eam-anthropic-tests

# Conflicts:
#	aimux-providers/layout.toml

@eric8810 eric8810 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase verified content-preserving: only master merges and layout.toml conflict resolution; CI 16/16. Re-approving current head.

…eam-anthropic-tests

# Conflicts:
#	aimux-providers/layout.toml

@eric8810 eric8810 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase verified content-preserving: only master merges and conflict resolution; CI 16/16. Re-approving current head.

…eam-anthropic-tests

# Conflicts:
#	aimux-providers/layout.toml

@eric8810 eric8810 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase verified content-preserving: only master merges and layout.toml union; CI 16/16. Re-approving current head.

@eric8810
eric8810 merged commit f068b78 into master Oct 27, 2026
16 checks passed
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.

3 participants