Files
OmniRoute/tests
Diego Rodrigues de Sa e Souza b56641bea6 feat(ollama): native Claude-format transport for Claude clients
Ollama Cloud exposes a native Anthropic-compatible /v1/messages endpoint.
A Claude-format client (sourceFormat="claude") is now routed straight to it
instead of through the lossy claude->openai->ollama bridge, preserving thinking
blocks, tool-use ids, and image fidelity.

Narrow, single-provider port — NOT a generic transport-selection framework:

- registry: new optional `claudeBaseUrl` on ollama-cloud (mirrors the existing
  `responsesBaseUrl` precedent) → https://ollama.com/v1/messages.
- resolveChatCoreTargetFormat: a Claude-format client on the allowlisted
  ollama-cloud provider resolves targetFormat="claude" (skips the openai bridge).
- resolveExecutionCredentials: stamps a marker read by the executor.
- DefaultExecutor.buildUrl/buildHeaders: route to claudeBaseUrl and add the
  Anthropic-Version header on that path; auth stays Authorization: Bearer.
- hasValidContent: recognize image/document-only Claude messages so an
  attachment-only turn is no longer dropped as empty on the passthrough.

TDD regression guards: tests/unit/chatcore-target-format.test.ts,
tests/unit/chatcore-execution-credentials.test.ts,
tests/unit/executor-ollama-cloud-claude-passthrough.test.ts,
tests/unit/translator-helper-branches.test.ts.

Co-authored-by: thienpv <pvtcwd@gmail.com>
Inspired-by: https://github.com/decolua/9router/pull/2475
2026-07-09 04:44:32 -03:00
..
2026-07-07 13:14:06 -03:00
2026-05-23 01:46:59 -03:00
2026-07-02 10:47:13 -03:00
2026-06-19 06:49:01 -03:00
2026-07-06 02:25:17 -03:00
2026-06-10 13:49:08 -03:00
2026-07-07 13:14:06 -03:00
2026-06-13 17:27:40 -03:00