Skip to content

fix: make translated Anthropic requests provider-valid - #487

Merged
alongubkin merged 2 commits into
mainfrom
alon/alien-571-provider-valid-cross-protocol-requests
Aug 24, 2026
Merged

fix: make translated Anthropic requests provider-valid#487
alongubkin merged 2 commits into
mainfrom
alon/alien-571-provider-valid-cross-protocol-requests

Conversation

@alongubkin

Copy link
Copy Markdown
Member

Summary

  • supply a bounded output-token default when OpenAI Chat Completions or Responses requests are translated to Anthropic Messages without a limit
  • treat an explicit null OpenAI limit as unspecified while preserving explicit numeric limits exactly
  • make the direct-Anthropic integration mock validate the provider-required max_tokens field and a real translated user message
  • cover both OpenAI request protocols with focused translation tests

Fixes ALIEN-571.

Validation

  • cargo fmt --all -- --check
  • cargo test -p alien-ai-gateway (89 unit tests, 9 runnable integration/live tests passed; credentialed cloud tests remained ignored)
  • cargo clippy -p alien-ai-gateway --all-targets --locked (passes with existing warnings)
  • strict -D warnings is currently blocked by existing workspace and gateway warnings unrelated to this diff

@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown

Greptile Summary

The PR makes OpenAI-to-Anthropic request translation provider-valid by supplying a bounded max_tokens default when the OpenAI limit is omitted or null.

  • Preserves explicit numeric output-token limits across both OpenAI protocols.
  • Adds focused unit and integration coverage for translated Anthropic requests.
  • Reduces Rust CI build and test concurrency.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
crates/alien-ai-gateway/src/protocol.rs Adds the required Anthropic output-token default and tests omitted, null, and explicit OpenAI limits.
crates/alien-ai-gateway/tests/integration.rs Strengthens direct-Anthropic integration coverage by validating native and translated request bodies separately.
.github/workflows/ci-fast.yml Reduces Rust compilation and nextest concurrency from twelve workers to eight.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[OpenAI Chat Completions] --> T[Protocol translator]
    B[OpenAI Responses] --> T
    T --> L{Output limit numeric?}
    L -->|Yes| P[Preserve explicit limit]
    L -->|No: omitted or null| D[Use 4096-token default]
    P --> M[Anthropic Messages request]
    D --> M
    M --> U[Anthropic provider]
Loading

Reviews (2): Last reviewed commit: "ci: reduce Rust test memory pressure" | Re-trigger Greptile

@alongubkin
alongubkin merged commit b2ea505 into main Aug 24, 2026
25 checks passed
@alongubkin
alongubkin deleted the alon/alien-571-provider-valid-cross-protocol-requests branch August 24, 2026 18:36
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.

1 participant