Skip to content

read identity-encoded bodies and treat /v1/embeddings as an embeddings path - #247

Merged
thushan merged 3 commits into
mainfrom
fix/inspector-identity-embeddings
Oct 27, 2026
Merged

thushan merged 3 commits into
mainfrom
fix/inspector-identity-embeddings

Conversation

@thushan

@thushan thushan commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Summary

A client that sent Content-Encoding: identity had its body skipped, so the model name was never read and the request was routed as if it named none.

body_inspector.go now counts identity as plain and reads the body. gzip, br and lists such as gzip, identity are still skipped.

Separately, path_inspector.go now treats /v1/embeddings as an embeddings path for capability routing. A model-less request whose body Olla can't read is kept off chat-only hosts, and gets a 503 capability_unavailable when embedders exist but none is healthy. Requests that name a model are unaffected.

Known limitation: only /v1/embeddings (and the TEI native paths) carry a path-level embeddings capability. A model-less request with an unreadable body (not JSON, or compressed) is still not narrowed to embedding-capable hosts on Ollama /api/embed and /api/embeddings, llama.cpp /embedding, LiteLLM /embeddings and LMDeploy /pooling. They are narrowed correctly when the body is readable, because input is the signal. This was left alone on purpose: those paths are either single-segment names that would claim deeper paths, or carry their model and input only in the body.

Type of change

  • Bug fix
  • Documentation

How was this tested?

New and updated tests:

  • TestBodyInspector_RepeatedContentEncodingHeaders and identity cases in body_inspector_test.go
  • /v1/embeddings case in path_inspector_test.go
  • an unreadable-body case in handler_proxy_embeddings_mixed_fleet_test.go

Tested together with the other October follow-up branches on a local integration branch at 0c25e0a:

  • make ready and make test-race pass at 0c25e0a
  • /olla-validate --quick: 42 pass, 0 fail (warnings and skips are nightly-only items)
  • tei-routing validation area: Section A 12/12, Section B B1 to B6 pass
  • /test-sticky-sessions: no new failures (the 7 provider-route 404s are the known shared-mock-URL limitation)
  • /claude-code-e2e against real Ollama: Tier A 16/0 on both the passthrough and translation legs, same as main
  • curl checks per feature against real Ollama and ollamock; log scan shows no panics, races or per-request WARN floods

Checklist

  • make ready passes at 09332f7
  • Tests added or updated for the change
  • Documentation updated: docs/content/concepts/model-routing.md, v0.0.30 release note
  • No new dependencies added

@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between e8ef6af and 09332f7.

Files selected for processing: 7
  • docs/content/about/release-notes.md
  • docs/content/concepts/model-routing.md
  • internal/adapter/inspector/body_inspector.go
  • internal/adapter/inspector/body_inspector_test.go
  • internal/adapter/inspector/path_inspector.go
  • internal/adapter/inspector/path_inspector_test.go
  • internal/app/handlers/handler_proxy_embeddings_mixed_fleet_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@thushan
thushan merged commit 0fd7205 into main Oct 27, 2026
6 checks passed
@thushan
thushan deleted the fix/inspector-identity-embeddings branch October 27, 2026 21:19
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