fix(catalog,anthropic): keep Claude combo image/effort capabilities and honor provider output budget - #3332
Conversation
…nd honor provider output budget
Two defects surfaced together when Claude models are exposed to Codex through
failover combos:
1. Combo members are usually thin discovery rows (id + context window). With no
capability source the modality/effort intersection collapsed to text-only and
an empty ladder, so the Codex app refused image attachments ("remove the image
or switch models") and hid the effort picker for every Claude combo.
resolveComboCatalogMember now falls back to the generated vendor metadata
table for input modalities and reasoning capability, and point-release ids
(claude-fable-5-1, date-pinned ids) resolve to their family row.
2. Codex never sends max_output_tokens, so the Anthropic adapter always used
max_tokens=8192. Long answers stopped with stop_reason=max_tokens and Codex
retried the identical turn up to five times. The adapter now honors the
provider's modelMaxOutputTokens / defaultMaxOutputTokens for omitted limits,
and the anthropic / anthropic-apikey registry entries default to 64000.
Explicit caller limits still win unchanged.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This PR stays in draft until every box above is ticked. Hygiene✅ Deterministic PR hygiene checks passed. |
리뷰 · 우선순위 67 / 80이 PR은 Claude 모델을 콤보(failover)로 Codex에 노출할 때 생기던 두 가지 사용자 체감 버그를 한번에 고친다. 지금 라인 provider-fetch.ts 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
|
Triaged in the 260904 bug-backlog closeout. The output-budget half is correct: honoring the configured provider budget in The catalog half has a blocking mapping error. In To land: map it to |
…redit redeems a stable identity (#3474) Reimplements #3332 by @full999, which could not be cherry-picked. One line differs from the original and it matters: the PR mapped the vendor table's maxTokens -- an OUTPUT ceiling -- onto maxInputTokens, and because aggregation takes Math.min over member input ceilings, a single Claude member would have dragged a 1M combo down to 128k and the auto-compaction budget from 900k to 128k with it. Also wires the reset-credit operation ledger, which was complete and had zero production callers while the consume endpoint minted a fresh UUID per call. An optional operationId now becomes the redeem_request_id. Opening fails closed, because falling back to a random id is the double-spend the identity prevents; settling fails open, because by then the credit is gone and reporting failure would invite a manual retry. Omitting operationId keeps today's behavior unchanged. Carried from #3327 by @olddonkey as well: two coverage holes from #3198, with one over-broad assertion narrowed. Also lands #3251 by @abhisheksharma2411: the GUI now consumes tierOutcome, which the backend already shipped and nothing displayed. Co-authored-by: full999 <daiki.furutani@walker-s.co.jp> Co-authored-by: olddonkey <olddonkeyblog@gmail.com> Co-authored-by: Abhishek Sharma <abhicse24@gmail.com>
|
Landed on Reimplemented rather than cherry-picked because this branch was CONFLICTING/DIRTY against current
Worth noting why your test did not catch this: Thank you for the capability work — the image/effort preservation and the provider output budget are both yours and both shipped. |
Summary
Two user-visible defects when Claude models are exposed to Codex through failover combos (e.g. a
claude-opus-5alias whose targets areanthropic/claude-opus-5→claude-sonnet-5→claude-fable-5):deriveComboCatalogModelintersected toinput_modalities: ["text"]and an emptysupported_reasoning_levels, so the Codex app showed "remove the image or switch models" and no reasoning-effort control for every Claude combo.resolveComboCatalogMembernow falls back to the generated vendor metadata table (src/generated/model-metadata.ts) for input modalities and reasoning capability when the caller supplied no fallback. Point-release / date-pinned ids (claude-fable-5-1,claude-opus-4-5-20251101) resolve to their family row. An explicit caller fallback (native aliases) still wins.max_output_tokens, so the Anthropic adapter always usedmax_tokens: 8192. Long answers ended withstop_reason: max_tokensand Codex retried the identical turn up to five times ("stream disconnected before completion: Incomplete response returned, reason: max_output_tokens"). The adapter now honors the provider'smodelMaxOutputTokens/defaultMaxOutputTokensfor omitted limits (mirroringresolveMaxTokensin the openai-chat adapter), and theanthropic/anthropic-apikeyregistry entries default to 64000. Explicit caller limits are unchanged; Anthropic still caps per model server-side.Observed on 2.33.0 and reproduced on
dev@ 878f754 before this change (combo rows:inputModalities: undefined,reasoningEfforts: undefined; adapter bodymax_tokens: 8192).Verification
bun test tests/codex-catalog.test.ts tests/anthropic-reasoning.test.ts tests/catalog-vision-sidecar-modalities.test.ts tests/provider-registry-parity.test.ts→ 391 pass / 0 fail (two regression tests added).tsc --noEmit -p tsconfig.json→ clean.~/.codex/opencodex-catalog.jsoncombo rows now carrytext,image+low…max;codex app-server model/listreports the same; a base64 image sent toclaude-opus-5via/v1/responsescompleted; a 9,344-output-token answer completed withoutmax_tokenstruncation (previously always cut at 8192).Checklist
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.