Skip to content

fix(anthropic): forward structured output schemas - #1464

Draft
Lqm1 wants to merge 8 commits into
lidge-jun:devfrom
Lqm1:codex/anthropic-structured-output
Draft

fix(anthropic): forward structured output schemas#1464
Lqm1 wants to merge 8 commits into
lidge-jun:devfrom
Lqm1:codex/anthropic-structured-output

Conversation

@Lqm1

@Lqm1 Lqm1 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Forward Responses and Chat Completions JSON Schema output formats through the Anthropic adapter as output_config.format.
  • Normalize JSON Schema to Anthropic's supported structured-output subset while preserving unsupported constraints in descriptions.
  • Preserve root $defs beside a root $ref, merge structured-output configuration with adaptive-thinking output_config.effort, and round-trip Messages structured output through stored OAuth.
  • Document the Anthropic compatibility transform, limitations, and maintenance decision.

Verification

  • bun test tests/anthropic-reasoning.test.ts tests/claude-inbound.test.ts tests/claude-messages-endpoint.test.ts tests/responses-parser.test.ts tests/responses-parser-malformed-content.test.ts tests/chat-completions-endpoint.test.ts tests/responses-compaction.test.ts tests/responses-compaction-routing.test.ts (270 passed)
  • bun test tests/api-storage-policy-put-race.test.ts (1 passed)
  • bun run typecheck
  • bun run privacy:scan
  • cd docs-site && bun install --frozen-lockfile && bun run build
  • Live AI SDK v7 Output.object request through the patched server on port 10101 using anthropic/claude-sonnet-5
  • The previous exact-head Cross-platform CI run passed all Linux shards, the unsharded macOS suite, gates, keyring, storage-policy, API-usage, and npm-global jobs; the current review-fix head is awaiting maintainer approval for the fork workflow
  • The unsharded local Windows suite remains affected by the repository's known Windows-only failures and Bun 1.3.14 panics; the related focused suites are green

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • All CI tests are green on my local testing.

  • I pushed my PR to the latest dev commit.

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Summary by CodeRabbit

  • New Features

    • Added structured JSON Schema output support for Anthropic requests.
    • Translated compatible OpenAI-style structured-output settings for Anthropic and Responses APIs.
    • Preserved schema references, definitions, compositions, nested structures, and supported constraints.
    • Retained existing output configuration when adding schema formatting.
    • Safely omitted unsupported or invalid output formats.
  • Bug Fixes

    • Invalid schemas lacking a type or composition are now rejected.
  • Documentation

    • Documented structured-output compatibility and schema normalization behavior.
  • Tests

    • Expanded coverage for schema forwarding, translation, and adaptive reasoning compatibility.

@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Anthropic structured-output requests now normalize JSON Schemas, preserve references and definitions, merge the result into output_config, and restore valid formats during inbound translation. Tests cover reasoning, Chat Completions conversion, OAuth routing, and invalid schemas.

Changes

Anthropic schema output

Layer / File(s) Summary
Schema normalization
src/adapters/anthropic-output-schema.ts
Adds recursive normalization for $defs, $ref, compositions, objects, strings, and arrays. Unsupported constraints are serialized into descriptions. Invalid root schemas are rejected.
Request output configuration
src/adapters/anthropic.ts, tests/anthropic-reasoning.test.ts, docs-site/src/content/docs/reference/adapters.md, structure/04-transports-and-sidecars.md
buildRequest normalizes JSON Schema text formats and merges them into body.output_config. Tests and documentation cover definitions, composition handling, reasoning settings, Chat Completions conversion, invalid schemas, and stored-OAuth routing.
Inbound output-format restoration
src/claude/inbound.ts, tests/claude-inbound.test.ts
Inbound translation validates Anthropic JSON Schema formats and exposes valid formats through body.text.format and parsed request options.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Possibly related PRs

  • lidge-jun/opencodex#524: Modifies provider-specific schema normalization, including $defs, $ref, and composition handling.

Suggested reviewers: lidge-jun, wibias, ingwannu

Sequence Diagram(s)

sequenceDiagram
  participant ResponsesRequest
  participant buildRequest
  participant normalizeAnthropicOutputSchema
  participant AnthropicAPI
  ResponsesRequest->>buildRequest: provide JSON Schema text format
  buildRequest->>normalizeAnthropicOutputSchema: normalize schema
  normalizeAnthropicOutputSchema-->>buildRequest: return normalized schema
  buildRequest->>AnthropicAPI: send merged output_config
Loading
sequenceDiagram
  participant AnthropicRequest
  participant formatFromOutputConfig
  participant parseRequest
  participant ResponsesRequest
  AnthropicRequest->>formatFromOutputConfig: provide output_config.format
  formatFromOutputConfig-->>parseRequest: return validated text format
  parseRequest->>ResponsesRequest: set body.text.format and options.textFormat
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes forwarding structured output schemas through the Anthropic adapter, which is the main change.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the bug Something isn't working label Aug 11, 2026
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed; the review readiness checklist is complete.

Review readiness checklist

  • ✅ All CI tests are green on my local testing.
  • ✅ I pushed my PR to the latest dev commit.
  • ✅ I resolved all correct Codex and CodeRabbit findings.
  • ✅ My PR is ready for review.

4/4 boxes ticked.

This pull request is already Ready for Review.
The review-ready label marks this PR as ready; review automation runs independently. If no CodeRabbit review appears, comment @coderabbitai review to request one.
Maintainers: @lidge-jun @Ingwannu @Wibias

@Lqm1
Lqm1 marked this pull request as ready for review August 11, 2026 07:41
@github-actions
github-actions Bot marked this pull request as draft August 11, 2026 07:41

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/adapters/anthropic-output-schema.ts`:
- Around line 33-43: Update normalizeSubschema so $defs are normalized and
attached to normalized before handling the $ref return; when both exist, return
normalized containing both $defs and $ref instead of returning only the
reference. Add a regression test covering a root schema with a `#/`$defs/...
reference and verify the emitted schema preserves its definitions.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2301959a-1347-40ec-a07d-877e314e339a

📥 Commits

Reviewing files that changed from the base of the PR and between e2f7f2b and e11073a.

📒 Files selected for processing (3)
  • src/adapters/anthropic-output-schema.ts
  • src/adapters/anthropic.ts
  • tests/anthropic-reasoning.test.ts

Comment thread src/adapters/anthropic-output-schema.ts Outdated

@Ingwannu Ingwannu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The direction is valuable and the current transform is much closer to the real Anthropic contract than silently dropping structured output. I compared the implementation with Anthropic's current TypeScript SDK transform and rechecked exact PR head e600c877: six adjacent parser/adapter/Chat/compaction suites pass 181/181, and typecheck plus privacy scan pass. I did not find a credential or destination-boundary problem.

I am requesting changes for three completion blockers:

  1. The PR promises both Responses text.format and Chat Completions response_format, but the new behavior tests call parseRequest() with a Responses body only. Add a regression that starts from the Chat Completions JSON Schema shape and proves the Anthropic request receives the expected output_config.format after the real inbound conversion. This boundary matters because src/chat/inbound.ts owns name, description, strict, and missing-schema normalization independently from the Anthropic adapter. The test should make explicit that Anthropic receives only its supported { type: "json_schema", schema } shape and that adaptive output_config.effort is preserved.
  2. This is user-visible adapter behavior and a non-trivial 125-line compatibility transform. Update docs-site/src/content/docs/reference/adapters.md with the supported Anthropic structured-output behavior and its limitations, and record the decision in the applicable structure/ document using the repository's [Decision Log] format. In particular, document why OpenCodex mirrors the SDK subset locally, why unsupported constraints are preserved in descriptions, why root $defs is retained beside a root $ref even though the current SDK transform returns on $ref, and the maintenance/tradeoff of copying that transform.
  3. The head is currently three commits ahead of and three commits behind current dev, while the full suite did not finish in the author's two attempts and the four readiness boxes remain open. Rebase onto current dev, rerun the focused tests/typecheck/privacy/docs build, then complete the readiness checklist only after exact-head CI is actually green.

Once those coverage, documentation, and exact-head gates are complete, this should remain a strong merge candidate. Please keep it draft until then.

@Lqm1
Lqm1 force-pushed the codex/anthropic-structured-output branch 2 times, most recently from f35d1da to b6b8dac Compare August 11, 2026 08:31
@Wibias
Wibias requested a review from Ingwannu August 11, 2026 08:31
@Wibias
Wibias marked this pull request as ready for review August 11, 2026 08:32
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The PR is marked ready for review. I will review the current changes.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The pull request is ready for review. I will review the current changes.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@github-actions[bot] Acknowledged. The pull request is marked ready for review.

You are interacting with an AI system.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs-site/src/content/docs/reference/adapters.md`:
- Around line 77-84: Update the structured-output documentation in
docs-site/src/content/docs/reference/adapters.md lines 77-84 to state that
structured output preserves compatible adaptive-thinking output_config.effort.
Also update structure/04_transports-and-sidecars.md lines 551-565 to document
that format merges into, rather than replaces, the existing adaptive-thinking
output configuration, while keeping output_config.effort compatible with the
structured-output format.

In `@src/adapters/anthropic-output-schema.ts`:
- Around line 47-56: Update the normalization logic around normalizeSubschema so
it removes only the composition keyword selected by the branch, preserving
unselected anyOf, oneOf, or allOf entries in schema for the fallback guidance
path. Ensure schemas containing multiple composition keywords retain every
unselected constraint, and add a regression test covering at least two
composition keywords.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ca8cb91f-9737-4ee9-96bb-4b1f5d601fc0

📥 Commits

Reviewing files that changed from the base of the PR and between e11073a and b6b8dac.

📒 Files selected for processing (4)
  • docs-site/src/content/docs/reference/adapters.md
  • src/adapters/anthropic-output-schema.ts
  • structure/04_transports-and-sidecars.md
  • tests/anthropic-reasoning.test.ts

Comment thread docs-site/src/content/docs/reference/adapters.md Outdated
Comment thread src/adapters/anthropic-output-schema.ts Outdated
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The pull request is ready. I will review the current changes.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot]: The readiness checklist is complete. I will review the current changes.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Lqm1
Lqm1 force-pushed the codex/anthropic-structured-output branch from b6b8dac to b9f846a Compare August 11, 2026 08:52
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@github-actions[bot] Acknowledged. PR #1464 is marked ready for review.

You are interacting with an AI system.

@github-actions
github-actions Bot marked this pull request as draft August 11, 2026 08:53
@Lqm1
Lqm1 marked this pull request as ready for review August 11, 2026 08:55
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@github-actions[bot] Acknowledged. PR #1464 is marked ready for review.

You are interacting with an AI system.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@github-actions[bot] Acknowledged. PR #1464 is marked ready for review. The readiness checklist is complete.

You are interacting with an AI system.

@Lqm1
Lqm1 force-pushed the codex/anthropic-structured-output branch from b9f846a to a093091 Compare August 11, 2026 12:02
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The readiness checklist and hygiene checks are complete. I will review pull request #1464.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions
github-actions Bot marked this pull request as draft August 11, 2026 12:02

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/claude/inbound.ts`:
- Around line 72-76: Update formatFromOutputConfig to validate format.schema
with the existing structured-output schema validator before returning the
translated json_schema format; preserve valid root $ref and $defs schemas, and
return undefined for unsupported schemas. Add an inbound regression test
covering an invalid schema such as one containing only description.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 787264c3-862f-4e59-b0a5-0a9ee32c6b43

📥 Commits

Reviewing files that changed from the base of the PR and between b9f846a and a093091.

📒 Files selected for processing (5)
  • docs-site/src/content/docs/reference/adapters.md
  • src/claude/inbound.ts
  • structure/04_transports-and-sidecars.md
  • tests/anthropic-reasoning.test.ts
  • tests/claude-inbound.test.ts

Comment thread src/claude/inbound.ts Outdated
@Lqm1
Lqm1 marked this pull request as ready for review August 11, 2026 12:09
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The readiness checklist is complete. I will review pull request #1464.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The readiness checklist is complete. I will review pull request #1464.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The readiness checklist is complete. I will review pull request #1464.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The readiness checklist is complete. I will review pull request #1464.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/claude/inbound.ts`:
- Around line 76-81: Update the JSON Schema return in the inbound format
conversion around isAnthropicOutputSchema to include a deterministic name such
as “response” alongside type and schema. Add or update the corresponding tests
in claude-inbound.test.ts to assert the complete final wire shape includes this
name.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d969d54c-9b52-455d-a231-5eda578fecef

📥 Commits

Reviewing files that changed from the base of the PR and between a093091 and 08b1dc1.

📒 Files selected for processing (3)
  • src/adapters/anthropic-output-schema.ts
  • src/claude/inbound.ts
  • tests/claude-inbound.test.ts

Comment thread src/claude/inbound.ts Outdated
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The readiness checklist and hygiene checks are complete. I will review pull request #1464.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions
github-actions Bot marked this pull request as draft August 11, 2026 12:20
@Lqm1
Lqm1 marked this pull request as ready for review August 11, 2026 12:22
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The readiness gate is complete for PR #1464. I will review the current changes.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@github-actions[bot] The readiness checklist is complete. I will review pull request #1464.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/claude-inbound.test.ts`:
- Line 184: Add a deterministic `name` field to the JSON Schema format emitted
by the inbound translator, updating the relevant logic in `inbound.ts`; then
update the `referenced.text` expectation in the test to assert the same name
alongside `type` and `schema`.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 95c1ab53-5f99-497b-8d62-cf45657d23c4

📥 Commits

Reviewing files that changed from the base of the PR and between a093091 and 08b1dc1.

📒 Files selected for processing (3)
  • src/adapters/anthropic-output-schema.ts
  • src/claude/inbound.ts
  • tests/claude-inbound.test.ts

Comment thread tests/claude-inbound.test.ts Outdated

@Ingwannu Ingwannu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Follow-up on exact head 3e42026f: the author has addressed the first two clusters from my requested-changes review. The real Chat Completions inbound conversion now has regression coverage, compatible adaptive effort is preserved, and the public docs plus [Decision Log] explain the local Anthropic SDK subset and root $defs divergence. The later inbound validation and deterministic name coverage are also present, and no unresolved review threads remain.

The remaining blocker is still the exact-head integration gate: this head is 45 commits behind current dev@849ab5e35, and the status rollup contains only hygiene/target checks, not the required cross-platform suite. Please rebase onto current dev and obtain green exact-head required CI. Until then my existing changes-requested state remains intentional; I am not asking for additional feature scope.

@Wibias Wibias left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-review on head 3e42026f against current dev@849ab5e35.

The earlier review findings around root $defs, composition fallback, Chat Completions coverage, inbound schema validation, deterministic Responses naming, docs, and the adaptive-thinking merge are addressed. I found one remaining integration blocker in the routed Claude Messages path.

handleClaudeMessagesWithBudget() extracts ocx-route / ocx-effort before anthropicToResponsesTranslation(). When an effort override is present it currently does:

anthropicBody.output_config = { effort: effortOverride };

That replaces the caller's entire output_config. A valid request carrying both output_config.format and the generated ocx-route + ocx-effort directives therefore loses the structured-output format before the new inbound translator can preserve it. The adapter-level merge added by this PR never sees the format.

Please merge the effort override into an existing object instead of replacing it, preserving output_config.format, and add an endpoint-level regression for a routed Claude Messages request that has structured output plus the route/effort directives. The final Anthropic wire body should contain both the overridden effort and the JSON-schema format.

Separately, this head is still 45 base commits behind current dev, and the exact-head Cross-platform CI / React Doctor runs are action_required with zero jobs. Rebase and exact-head CI are still required after the code fix.

@Wibias
Wibias marked this pull request as draft August 11, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working review-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants