Repository navigation
fix(plugin-sdk): expose async embedding batch runtime - #129625
Patrick-Erichsen merged 8 commits into
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: blocked before merge. Reviewed September 10, 2026, 4:00 PM ET / 20:00 UTC (Revision 17). ClawSweeper reviewWhat this changesAdds public TypeScript contracts that let embedding plugins describe asynchronous batch jobs without importing private memory types. Merge readiness⛔ Blocked before merge - 4 items remain This remains a useful, distinct SDK addition: current main lacks the public contract, and the related merged refactors do not replace it. No actionable correctness defect was found; public API acceptance remains unresolved. Priority: P2 Review scores
Verification
How this fits togetherMemory indexing sends text chunks and execution options to registered embedding providers, which return vectors or request the existing fallback. The plugin SDK gives external providers a supported way to describe that batching capability. flowchart LR
A[Memory documents] --> B[Memory indexing host]
C[Public batch contract] --> D[Registered embedding plugin]
B --> E{Batch capability available}
E -->|Yes| D
E -->|No| F[Inline embedding fallback]
D --> G[Embedding vectors]
F --> G
Decision needed
Why: The implementation is narrow and preserves runtime behavior, but supporting this API and expanding its budget requires maintainer intent that tests cannot establish. Before merge
Agent review detailsSecurityNone. PR surfaceSource +28, Tests +21, Docs +4, Config +8, Other +25. Total +86 across 13 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Adopt a supported batch-only contract shared by generic and memory providers, with SDK-owner acceptance and existing fallback and per-file defaults preserved. Do we have a high-confidence way to reproduce the issue? Not applicable as a runtime bug: this adds a supported SDK capability. Current source confirms the missing public import, and contributor evidence records TS2307 before the addition. Is this the best way to solve the issue? Yes, technically: the shared batch-only type owner avoids duplicate options and keeps internal metadata private; accepting it as a supported public API remains a maintainer decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7e1b9a63cf64. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (16 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review The P1 rank-up move is complete: the public facade now exports the batch-only Exact pushed head: |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
a6f391a to
98050ce
Compare
98050ce to
9d509b6
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Preserve the SDK overview split and combine public export increments.
|
Landing review complete for d09c7cd4546826c774dda25d8e79cfe66520a66d. Maintainer decision: accept the narrow public batch contract and its increase of one SDK subpath and three type exports. The public surface contains text chunks, execution options, and the provider batch callback; cache identity and other host metadata stay internal. This resolves the API-acceptance/next-step items in the latest ClawSweeper review. Its data-model migration item is inapplicable: this patch changes types and package exports, with no persisted-data, schema, provider-job, scheduling, or fallback implementation change. Before/after proof: the contributor recorded TS2307 when an external NodeNext consumer imported the absent subpath. Current main still lacks that export. On the exact candidate head, CI build-artifacts job 103024464525 ran Validation:
Production/export metadata: +49/-12 (net +37); tests/consumer proof: +44/-1; SDK budget guard: +4/-2; docs: +7/-3. The new shared contract removes duplicate memory option fields. No additional adapter or runtime path is needed. Proof limit: no live embedding-provider job was submitted; the changed boundary is the compiled public package/type contract. The original failing consumer evidence is contributor-supplied, while the current-head passing package build was independently verified. Thanks @ekinnee. |
|
Merged via squash.
|
What Problem This Solves
External embedding-provider plugins need a public typed contract for provider-owned asynchronous batch jobs. The memory host already supports
batchEmbed(...)and source-wide batching, but those capabilities are only described by internal memory types on current main.This restores the work from #126772, which closed when its source fork was deleted. The refresh incorporates the contract unification from #130506; the private-local adapter introduced by #139911 does not provide this public typed batch surface.
Why This Change Was Made
Expose
EmbeddingBatchChunk,EmbeddingBatchOptions, andEmbeddingProviderBatchRuntimethroughopenclaw/plugin-sdk/embedding-provider-runtime-contract. The capability contains the batch callback and optional booleansourceWideBatchEmbed; cache identity, aliases, and timeout metadata remain internal. Onlytrueopts into source-wide batching, preserving existing false/omitted behavior and normal object inference.The generic runtime composes the optional capability. Memory-specific options extend the same canonical text contract with their internal multimodal input. This removes duplicate option fields without reintroducing the adapters removed upstream. Package export maps and the SDK surface budget are regenerated for one public subpath and three type exports.
User Impact
Provider plugins, including OpenAI-compatible routing plugins, can type their asynchronous text-batch implementation without importing internal memory metadata. The host's batching algorithm, fallback behavior, configuration, and persisted state are unchanged.
Evidence
Full build, changed-file gates, and review validated
98050cee974ebb509bad3704799ea094fcf27158on base4032753c9e91af0c94b0bd83107d00a44d0887ee. Final candidate9d509b65f7a88b17cd3c2e8c4ecc1d752b925ce8rebases that patch onto8184a1107dfd26c2a7003112cdafbad1571d182a. The sole conflict was the SDK export budget: preserve upstream's added export and regenerate the combined count (4,449). No batch-contract behavior changed. After rebase, all 17 focused runtime/surface tests, export synchronization, and whitespace checks passed. Broad gates were not repeated for this mechanical counter resolution.pnpm build:plugin-sdk:strict-smokepassed: all 153 public SDK subpaths and the real external NodeNext consumer verified; 53 built control-plane modules checked.node scripts/run-vitest.mjs src/plugins/memory-embedding-provider-runtime.test.tspassed.node scripts/run-vitest.mjs test/scripts/plugin-sdk-surface-report.test.tspassed all 10 tests outside the execution sandbox; the initial sandbox run prevented four subprocess assertions from receiving output.tsgo.node scripts/check-changed.mjs -- <all 13 changed paths>passed, including format, SDK surface/boundary guards, all typecheck lanes, dead-export scans, lint, and zero runtime import cycles.pnpm docs:listandgit diff --checkpassed.Production/export metadata: 8 files, +49/-12 (net +37). The growth creates the missing public capability and package entry while removing duplicate memory option fields. Tests/consumer proof: +44/-1; SDK budget guard: +4/-2; documentation: +7/-3. No runtime implementation paths were added.
Real Behavior Proof
The changed boundary is a public type/package export. The external NodeNext consumer fails with TS2307 before the public subpath exists. The built-package consumer verifies all three public types, true/false/omitted source-wide settings, and rejection of internal cache policy. The runtime regression verifies that the registered provider's batch callback reaches the host unchanged.
AI-assisted: Codex