Repository navigation
fix(memory): preserve wiki corpus in direct agent scopes - #133234
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 9:29 AM ET / 13:29 UTC. ClawSweeper reviewWhat this changesThe PR carries eligible root-owned memory corpus and prompt registrations into same-workspace direct agent scopes without rerunning plugin setup. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open: current main lacks the direct-scope handoff, and this PR remains the concrete linked fix candidate. Source review found no introduced functional or security defect; the adoption is gated by workspace, activation, and source ownership. Priority: P2 Review scores
Verification
How this fits togetherDirect agent turns build a scoped plugin registry before memory search and prompt assembly consume it. The Gateway root registry holds fully initialized plugin sidecars, which this change conditionally reuses for the direct scope. flowchart LR
A[Gateway root plugin registry] --> B[Direct agent entry]
B --> C[Discovery scoped registry]
A --> D{Same workspace and plugin enabled?}
D -->|Yes| E[Reuse memory sidecars]
D -->|No| C
E --> F[Memory search and prompt assembly]
C --> F
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +104, Tests +128. Total +232 across 4 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Retain the narrow, generic sidecar handoff at the direct-registry boundary, preserving the existing same-workspace, effective-activation, and source-identity controls. Do we have a high-confidence way to reproduce the issue? Yes—source establishes the path: a direct agent scope starts with an empty base registry while the load plan only selects the memory-slot owner, leaving separately registered wiki sidecars absent. The submitted body also reports an exact-head production-boundary run, but this reviewer did not execute untrusted contributor code. Is this the best way to solve the issue? Yes. The repair is at the scoped-registry boundary that loses the registrations, reuses exact root objects without re-running plugin code, and leaves the Memory Core consumer unchanged. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f46f9b5aa39f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Thanks @PollyBot13! Proof: A direct agent turn with the configured bundled
Example
|
…133234) Direct agent scopes now reuse eligible same-workspace memory sidecars from the active plugin runtime. This preserves wiki corpus search, prompt guidance, and prepared prompt context without rerunning plugin registration. Disabled, cross-workspace, and conflicting-source owners remain unavailable. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes #133196.
A direct agent turn could bind an empty-base request plugin registry while the active same-workspace Gateway registry still owned a healthy
memory-wikiruntime.memory_searchthen reportedwiki: not-registeredeven though the plugin, vault, and wiki CLI remained healthy.The first submitted fix copied only the corpus registration. It still dropped the wiki prompt registrations and rejected plugins that canonical config processing had enabled automatically.
Why This Change Was Made
Direct agent scopes now reuse the active root's exact memory sidecar objects without rerunning plugin registration code.
The handoff preserves all three sidecar types registered together by
memory-wiki:The boundary stays narrow:
The direct binder carries its prepared metadata snapshot into the activation check. This avoids a second metadata lookup and keeps plugin policy in the existing activation owner.
User Impact
Configured wiki search and wiki prompt guidance remain available in direct agent turns whenever the active same-workspace runtime owns the wiki sidecars. Explicitly disabled, differently scoped, or shadowed plugins remain unavailable.
There is no configuration, schema, SDK, vault-data, or migration change.
Evidence
be67a8bdf62e04cd3ae4cc531371c5e8e582f390loaded the real bundledmemory-wikiowner and its corpus registration, then returnedwiki: not-registeredthrough the production direct-agent binder and Memory Core corpus consumer. Current main has no later behavior change in the four owner files.8aad0f8f5ceb9f990e09c416ae4d10698a0e33bffixed an explicitly enabled corpus, but a config-driven auto-enabled wiki still returnednot-registeredand the direct prompt omittedCompiled Wiki.760e505b29edb8b6c7a5aa11935d9a61777c0c20returnedsources/runtime-proof.mdfor a unique query and includedCompiled Wikiin the direct prompt. Global plugin disablement and another workspace both remainednot-registered.runtime-plugins.memory-corpus.integration.test.ts,runtime-plugins.test.ts, andmemory-state.test.ts.+106/-2(net+104); tests+128/-0. The growth defines one exact owner handoff for three runtime-only sidecar classes plus canonical activation. An attempted reuse of the normal plugin load plan was rejected because it reran plugin registration and broke exact root-object identity.AI-assisted: yes (Codex).