feat(api): OpenAI-compatible POST /v1/embeddings - #133
Conversation
Gateway consumers (OpenAI SDKs, naruon callers) can embed without the batch poll lifecycle. Uses the existing embeddings backend + cost ledger; local backend completes in-process with deterministic vectors.
|
Warning Review limit reached
Next review available in: 22 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
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. Comment |
Pull request was converted to draft
There was a problem hiding this comment.
Pull request overview
OpenCode cannot approve yet because required coverage evidence did not pass.
Review outcome
1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
-
Problem: The required coverage-evidence job result was
failure, so OpenCode cannot establish approval sufficiency for this head. -
Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.
-
Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports
successwith required evidence or explicit no-source not-applicable evidence. -
Regression test: Keep the approval branch checking
needs.coverage-evidence.result == successbefore posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present. -
Result: REQUEST_CHANGES
-
Reason: coverage-evidence result was
failure, so required test/docstring evidence was not proven for current heade36d0b19e6e33eec2baf6da12e1090ed38d9512d. -
Head SHA:
e36d0b19e6e33eec2baf6da12e1090ed38d9512d -
Workflow run: 31702411945
-
Workflow attempt: 1
Coverage evidence
Coverage evidence job did not run or did not publish coverage evidence.
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file (6 files)"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file (6 files)"]
R1 --> V1["required checks"]
Evidence --> S2["Docs: architecture.md"]
S2 --> I2["operator or user guidance"]
I2 --> R2["Review risk: Docs: architecture.md"]
R2 --> V2["docs review"]
Evidence --> S3["Test: test_openai_embeddings.py"]
S3 --> I3["regression suite"]
I3 --> R3["Review risk: Test: test_openai_embeddings.py"]
R3 --> V3["targeted test run"]
OpenCode Review Overview
Pull request overviewOpenCode cannot approve yet because required coverage evidence did not pass. Review outcome1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
Coverage evidenceCoverage evidence job did not run or did not publish coverage evidence. Changed-File Evidence Mapflowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file (6 files)"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file (6 files)"]
R1 --> V1["required checks"]
Evidence --> S2["Docs: architecture.md"]
S2 --> I2["operator or user guidance"]
I2 --> R2["Review risk: Docs: architecture.md"]
R2 --> V2["docs review"]
Evidence --> S3["Test: test_openai_embeddings.py"]
S3 --> I3["regression suite"]
I3 --> R3["Review risk: Test: test_openai_embeddings.py"]
R3 --> V3["targeted test run"]
|
Status: Draft — embedding/model provenance is not honest enough to merge
This PR exposes a useful buyer-facing endpoint shape, but the current implementation must not be marked Ready or merged.
Exact identity
main@6841b71935e0b7cb98fb52bcb4709cc5100c8d87e36d0b19e6e33eec2baf6da12e1090ed38d9512dNo predecessor, status-only, synthetic-merge, or local result transfers after this head changes.
Valid product requirement
Provide a provider-neutral OpenAI-compatible
POST /v1/embeddingsendpoint with bounded inputs, exact backend/model identity, usage and cost provenance, deterministic error semantics, and standalone plus modular operation.Current root defect
The endpoint reuses
LocalEmbeddingBatchBackend, whose protected-main implementation creates an 8-dimensional SHA-256-derived offline test vector. That helper explicitly states that it is not semantically meaningful and exists only to exercise the batch lifecycle without a provider call.This PR nevertheless accepts an arbitrary requested
model, echoes that model in the OpenAI response, and routes the document through the cost ledger. A caller can therefore receive a local heuristic vector and evidence that appears to attribute it to the requested provider/model even though that model did not execute. A deterministic vector is not equivalent to a real embedding model, andbackend: localas a nonstandard extension does not repair the false standard-field provenance.The branch also copies suppression-only SQL, dynamic-urllib, and unverified-TLS annotations instead of inheriting the accepted source-level security boundary from PR #96.
Required test-first repair
Before Ready, rebuild this endpoint on the exact protected security line and prove:
model, dimensions, encoding, usage, provider/backend evidence, and ledger attribution all describe the same executed operation;nativeor provider-produced;Do not close the underlying buyer requirement, but do not enable auto-merge or mark this branch Ready until one honest execution and provenance contract exists.