Repository navigation
refactor(embeddings): own the per-call deadline contract - #188548
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. What this changesThis PR moves the per-call deadline contract into the embedding contract owner while preserving memory aliases and migrating three provider readers. Example: A managed Ollama service takes 40 seconds to become ready during a memory search.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this maintainer-authored PR open: the ownership refactor is coherent, but its new diagnostic assertion causes an exact-head CI failure. Priority: P3 Before merge
Findings
Tests
Agent review detailsHow this fits togetherMemory search supplies a per-call deadline control; embedding providers report managed-service readiness pauses through it, while cancellation remains on AbortSignal. flowchart LR
A[Memory search] --> B[Deadline control factory]
B --> C[Shared embedding deadline symbol]
C --> D[Embedding provider adapters]
D --> E[Managed service readiness]
E --> B
D --> F[Embedding HTTP request]
Technical reviewBest possible solution: Retain the focused contract relocation and compatibility aliases, and correct the diagnostic assertion without weakening its missing-member check. Do we have a high-confidence way to reproduce the issue? This PR requests a behavior-preserving refactor rather than a runtime bug fix; its newly introduced test failure is directly established by exact-head CI. Is this the best way to solve the issue? The existing embedding contract owner is the appropriate home for this shared channel, and retaining aliases avoids splitting symbol identity or changing existing callers. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8163a1d77101. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +9, Tests +53, Other +2. Total +64 across 9 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 30, 2026, 1:26 PM ET / 17:26 UTC. |
|
Merged via squash.
|
…8548) * refactor(embeddings): own the per-call deadline contract * test(embeddings): expect the missing observer diagnostic
Related: #188252
What Problem This Solves
Generic embedding execution obtains its per-call deadline contract from the memory host.
User Impact
No intended behavior change. Existing memory callers retain the same deadline channel, balanced readiness budgeting, cancellation and resource settlement.
Why This Change Was Made
Move the symbol and full report/subscribe/options contract into the existing embedding owner and private SDK facade; migrate OpenAI-compatible, Ollama and LM Studio readers together. Memory retains direct aliases and its byte-identical control factory. No new manager, package, public subpath, configuration option, authority or batch contract.
Production +9 lines; tests +53 lines. The exact 53-line allocation covers independent SDK-loader identity and strict legacy/canonical key/options compatibility; the shared scalar is unchanged.
Evidence
Fresh independent full-range review of 09c7676..69406e7 found no actionable correctness/security issues. Formatting, syntax, whitespace and normal signed commit hooks passed.
Qualified native proof at prior head a1877f0 used a private frozen install, Node 26.13.0 and explicit Node test workers:
The native strict consumer test correctly rejected all four invalid controls but exposed an incorrect expected diagnostic: missing subscribe is TS2741, not TS2418. Replacement 69406e7 changes only that expected integer; all production, dependency, allocation and other test inputs are byte-identical. The corrected strict consumer test passed at exact replacement head 69406e7 (1/1, 2.70s command wall); all four exact rejection controls and positive key/observer assignments remain intact. Replacement exact-head CI passed. Prior-head proof stays labeled as such and will be reused only for unchanged inputs. No live provider calls were made.
Native landing evidence: required CI run 41100228308 passed at reviewed replacement head 69406e7. Root inspected the full cutover, both fresh review reports, strict negative controls and built-output identity proof. Qualified native proof is labeled by its actual head above; no live provider or before/after performance claim.