Repository navigation
fix(knowledge): start workers on Bun and standalone builds - #183771
Conversation
Use runtime-owned SDK alias resolution inside both workers and declare their client-owned entrypoints in the canonical process manifest. Resolve worker URLs through the existing SDK contract so source, package, and embedded builds use the same worker inventory.
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Regenerate the daemon runtime probe and its script inventory after declaring Knowledge registry and storage workers. This repairs the script freshness gate that stopped both compact tests and browser bootstrap CI before their runtime checks.
|
Codex review: needs maintainer review before merge. What this changesThis PR adds Bun-compatible SDK resolution to Knowledge workers and declares both workers for standalone packaging. Example: An agent invokes knowledge_ontology with Knowledge enabled under Bun.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a current-main Knowledge startup failure with a focused change; no actionable introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherKnowledge clients dispatch registry and vault operations to worker threads, which load the host-selected SDK modules and return operation results; the runtime manifest supplies their build and packaging identities. flowchart LR
A[Knowledge tool request] --> B[Registry and storage clients]
C[Runtime process manifest] --> B
C --> D[Standalone worker inventory]
B --> E[Worker SDK resolver]
E --> F[Registry and storage hosts]
F --> G[Knowledge stores]
Technical reviewBest possible solution: Use the existing runtime manifest for worker identity and install the host-selected SDK aliases with each runtime's native resolver. Do we have a high-confidence way to reproduce the issue? Current source confirms the Node-only worker bootstrap and missing standalone declarations; the body reports the matching Bun failure, but no independent runtime reproduction was performed. Is this the best way to solve the issue? The patch addresses both causes through existing owners, preserves SDK selection and authority checks, and removes the replaced URL helper without adding configuration or persistent state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 763ae526e3fb. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +50, Tests +92, Docs +5, Generated 0. Total +147 across 12 files. Added test files: 1. View PR surface stats
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 25, 2026, 3:07 PM ET / 19:07 UTC. |
|
Merged via squash.
|
…183771) * fix(knowledge): start workers on Bun and standalone builds Use runtime-owned SDK alias resolution inside both workers and declare their client-owned entrypoints in the canonical process manifest. Resolve worker URLs through the existing SDK contract so source, package, and embedded builds use the same worker inventory. * chore(knowledge): refresh generated worker inventories Regenerate the daemon runtime probe and its script inventory after declaring Knowledge registry and storage workers. This repairs the script freshness gate that stopped both compact tests and browser bootstrap CI before their runtime checks. * chore(knowledge): document Bun worker runtime invariant
What Problem This Solves
Knowledge's registry and storage workers fail on Bun with
Export named 'registerHooks' not found in module 'node:module'. Standalone images also omit both workers because they were missing from the canonical runtime-process manifest.User Impact
Removes Knowledge's Bun startup blocker and includes its registry and storage workers in standalone builds. Node behavior and the host's selected SDK modules are preserved. Signed AOT artifact qualification remains pending.
Why This Change Was Made
Both workers install SDK aliases through the selected runtime's native resolver before loading storage code. Their declarations and generated runtime inventories are kept in sync. Their clients use the existing declared-worker URL contract for source, packaged, and standalone layouts. The asset-location module stays free of SDK imports so worker bootstrap does not need those aliases before installing them.
Evidence
registerHooksimport.sdkUrls()feed real registry/storage clients successfully on Node and Bun: registry snapshot and storage partitions complete, including the worker-side authority check.onResolvelimitation; this PR does not change compiler code or suppress that test.runtime:scripts:checknow pass. The browser CI failure occurred at that same pre-test gate.knowledge_ontology, which provisions an isolated store and starts both embedded workers;knowledge_statusalone does not exercise storage startup.