Skip to content

test: port the cc_convert conversion fixture corpus#143

Merged
Meirtz merged 1 commit into
masterfrom
test/anthropic-transform-fixtures
Jul 3, 2026
Merged

test: port the cc_convert conversion fixture corpus#143
Meirtz merged 1 commit into
masterfrom
test/anthropic-transform-fixtures

Conversation

@Meirtz

@Meirtz Meirtz commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Ports the conversion fixture corpus from the deferred #122 stage F tree (fixtures only — zero Rust, zero scripts) and runs the Python Anthropic↔OpenAI transforms (agentix.bridge.clients._anthropic_transforms) against it as a parametrized golden-parity suite.

  • 124 fixture files under plugins/abridge/tests/fixtures/anthropic_openai/: 32 request cases (anthropic/openai/tool_map triples), 6 response cases, 5 stream cases.
  • Licensing: upstream cc_convert is MIT OR Apache-2.0; fixtures are redistributed under MIT with the license text and an attribution README (origin, layout, golden provenance) alongside.
  • Every known Python-path gap is xfail(strict=True) with a precise reason — the xfail table doubles as the prioritized gap list (22 entries): image blocks, tool_choice any/named/auto/none, thinking/reasoning (requests and streams), stop_sequences, metadata.user_id, top_k, >64-char tool names, cached-token usage, empty-content shape, stream-without-finish_reason.
  • Comparison normalizations are documented in-code and deliberately narrow (null==absent for LiteLLM serialization artifacts, generated message ids, text-only content folding); non-text parts keep their shape so dropped images fail.
  • Streams: the Python path has no incremental SSE translator (it replays the finished response via anthropic_sse), so the suite tests final-assembled-response equivalence and says so; chunk-fidelity is out of scope until a streaming seam exists.

Notable findings

  • The issue-predicted o-series max_completion_tokens gap does not manifest — the golden keeps max_tokens for o3-mini and the case passes.
  • One golden is itself invalid (stream 29_two_parallel_tool_calls: LiteLLM artifact merges two parallel tool calls into one block with concatenated partial_json); skipped with the reason recorded, not xfailed, so the xfail list stays a pure gap list.
  • No case the transforms claim to support produced wrong output under fair comparison.

Testing

  • Suite: 21 passed, 1 skipped, 22 xfailed (strict — a silently fixed gap will XPASS-fail and demand its xfail be removed)
  • Pre-existing test_anthropic_transform.py: 9 passed, unchanged
  • ruff check clean

Closes #141.

🤖 Generated with Claude Code

…transforms

Vendor the golden conversion fixtures from cc_convert
(github.com/yitianlian/cc_convert, MIT OR Apache-2.0; redistributed
under MIT with attribution README + license text) and run the pure
Python transforms in agentix.bridge.clients._anthropic_transforms
against them:

- requests (32 cases): anthropic_messages_to_openai vs golden, with a
  documented normalizer (null==absent, text-only content-list folding,
  empty tool description == absent).
- responses (6 cases): openai_to_anthropic_messages vs golden, with
  only the generated message id excluded.
- streams (5 cases): no incremental OpenAI-SSE seam exists in the
  Python path, so the tests assert final-assembled-response
  equivalence through openai_to_anthropic_messages + anthropic_sse;
  one case is skipped because its golden is itself a LiteLLM
  stream-translator artifact.

Every known Python-path gap is xfail(strict=True) with a precise
reason, so the xfail table is the prioritized gap list: images,
tool_choice (any/named/auto/none), thinking/reasoning_effort,
thinking history, stop_sequences, top_k/stream passthrough,
metadata.user_id, >64-char tool names, cached-token usage, empty
content handling, aborted-stream stop_reason, reasoning deltas.

Result: 21 passed, 1 skipped, 22 xfailed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Meirtz Meirtz merged commit 49c25c1 into master Jul 3, 2026
5 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.

abridge: port the cc_convert fixture corpus to cover the Python Anthropic↔OpenAI transforms

1 participant