Skip to content

fix(translator): harden Claude format detection for model validation - #9253

Merged
diegosouzapw merged 2 commits into
release/v3.8.50from
fix/port-pr-2949-translator-model-validation-format
Aug 4, 2026
Merged

diegosouzapw merged 2 commits into
release/v3.8.50from
fix/port-pr-2949-translator-model-validation-format

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Summary

  • accept relative Claude message endpoints during request-format detection
  • recognize kebab-case anthropic-version metadata as a Claude-format signal
  • preserve the existing endpoint-first detection and absolute-URL behavior

Attribution

Thanks to @ervareza for the original implementation.

Changes

  • make detectFormatFromUrl parse relative and absolute URLs safely
  • add anthropic-version detection for array and string message content
  • add focused regressions for Claude Code model-validation requests

Test plan

  • focused + neighboring Node tests: 17 passed
  • ESLint on changed files
  • Prettier on changed files
  • npm run typecheck:core
  • npm run check:docs-all
  • npm run check:cycles
  • npm run typecheck:noimplicit:core — blocked by existing implicit-any errors in open-sse/utils/usageTracking.ts and src/shared/services/cliRuntime.ts
  • npm run test:vitest — 28 files / 256 tests passed; 6 MCP suites cannot import js-tiktoken because the local base64-js installation is empty (the same failure reproduces in the release checkout)
  • npm run check — lint completed; the broad unit run was interrupted after reproducing the same dependency-layout failure plus credential-dependent 401 checks

@diegosouzapw

Copy link
Copy Markdown
Collaborator Author

Merged via local merge-train on 192.168.0.113 (32 cores) @ train tip e3a7696bb969536578f6a2defeada7d04fa9d1f9 — log /srv/omniroute-train/.claude/worktrees/merge-train-20260804-120425-suite.log.

Green: typecheck:core, check-complexity, check-cognitive-complexity, check-changelog-integrity, test:vitest (34 files / 291 tests).

Reds, each discriminated against the clean release tip 2e4268003 with zero PRs boarded (merge-gates §3):

  • check-file-size — src/sse/handlers/chat.ts 1846>1845 and open-sse/executors/base.ts 1623>1578 reproduce with identical numbers on the bare tip. Baseline drift for the release captain; not introduced here.
  • test:unit — 15 failures, all reproduced identically on the bare tip. Thirteen are the bare-model routing assertions (OpenAI remains the historical default, getModelInfoCore keeps unprefixed gpt-5.5 on the OpenAI fallback, …) left stale by fix(routing): bare model ids route to codex first; validate synced candidates #9275, which intentionally moved bare gpt-5.5/gpt-5.6-sol to codex without updating them; two are the trailing-period message change already covered by test(sse): expect the trailing period in the no-credentials message #9392.
  • provider-limits-local-apikey-sync-spacing — the only failure not on the bare tip, and a load flake: the assertion requires a ~0ms gap and measured 25/49ms under a 32-core full-suite run. Passes 3/3 in isolation on this exact train tip.

No red attributable to this PR.

@diegosouzapw
diegosouzapw merged commit 2cb77bb into release/v3.8.50 Aug 4, 2026
21 checks passed
@diegosouzapw
diegosouzapw deleted the fix/port-pr-2949-translator-model-validation-format branch August 4, 2026 20:50
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…heaper-inference#9253)

* fix(translator): harden Claude format detection for model validation

Co-authored-by: Ervareza Naurian <rianskp644@gmail.com>
Inspired-by: decolua/9router#2949

* chore(changelog): fragment for cheaper-inference#9253

---------

Co-authored-by: diegosouzapw <diegosouzapw@users.noreply.github.com>
Co-authored-by: Ervareza Naurian <rianskp644@gmail.com>
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