Repository navigation
refactor(memory-wiki): share tool registration and result adapters - #135066
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 5:51 AM ET / 09:51 UTC. ClawSweeper reviewWhat this changesThe PR deduplicates Memory Wiki tool registration callbacks and replaces repeated plain-text result envelopes with the existing Plugin SDK helper. Merge readiness✅ Ready for maintainer review Keep this fresh, maintainer-authored PR open. Current main still has the duplicated registrations and result envelopes, while the introduced refactor preserves their context and output contracts; no actionable defect was found. Priority: P3 Review scores
Verification
How this fits togetherMemory Wiki is a bundled plugin that registers tools for agents to query and maintain a local knowledge vault. The plugin maps agent context into tool factories, which perform vault operations and return model text plus structured details. flowchart LR
A[Agent tool request] --> B[Memory Wiki plugin]
B --> C[Resolve agent context]
C --> D[Wiki tool factory]
D --> E[Vault query or mutation]
E --> F[Text and structured result]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -39. Total -39 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Merge the compact refactor once the exact-head required checks complete, retaining the existing SDK result helper and current context-projection tests. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors existing adapter code rather than fixing a reported failing behavior. Is this the best way to solve the issue? Yes. Reusing the established SDK helper removes duplicated envelopes while the typed loops preserve the two pre-existing tool-context shapes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a0866b51da27. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Memory Wiki's tool adapter repeated two pairs of factory registrations and seven plain-text result envelopes. The registration pairs now share their existing context projection, and the tools use the lightweight SDK
textResulthelper. The five named tools still register synchronously in the same order; status retains its distinct callback.The factories resolve the current app configuration and service signal on every invocation. Agent/session/sandbox/recall context, context-free multi-agent omission, unknown-agent errors, stop/restart fencing, and independent tool objects remain unchanged. Result text, detail references, own-property order,
undefinedvalues, spread precedence, lint report projection, and error rejection behavior are preserved. Invalidwiki_getinput still returns before filesystem work, while a successful empty read remainsfound: true.This removes 39 production lines (+49/−88), all nonblank/noncomment adapter code across the two owners. It adds no helper, type, public API, configuration, dependency, schema, or storage behavior. Tests and generated files are unchanged. The newly imported SDK helper and registration contracts exist at the plugin's stable peer floor,
v2026.8.1, as verified from the immutable local tag.Validation covers 83 maintained tests across seven files and all 24 selected changed-file checks, including production/test types, lint, all three unused-export scans, doctor contracts, plugin boundaries, and zero runtime import cycles. Fresh managed P2 review is clean. A temporary integration harness invokes the actual plugin registration, all five factories, and real isolated vault operations before and after the patch: 64 tool invocations and 88 capture records match across 2,220,243 normalized bytes, including 1,074 own-undefined nodes and four shared-reference nodes. Only three temporary vault path prefixes are normalized; error stacks are retained separately, while names/messages/descriptors remain compared.
The integration proof uses a synthetic host API/KV/blob store and external memory/session seams with real filesystem, query, lint, mutation, compile, and lifecycle code. It does not claim a live Gateway, model/provider, operator store, or remote memory-engine run. One initial baseline attempt hit the unchanged silence watchdog before tests; another exposed an incorrect fixture assumption about search-only recall context. Both are preserved, and the corrected baseline/candidate captures pass without changing production policy or increasing timeouts. Whether recall should also restrict ordinary explicit reads is a separate product-contract question, not a fixed bug in this refactor. No release changelog entry is required for this internal simplification.
The latest 09:51 UTC ClawSweeper review is code-clean with no before-merge finding or rank-up list. The automatic storage/vector classification is false: only registration and result envelopes change; no database, schema, embedding, migration or persisted data code changes. Exact-head CI 33493810666 is green; maintainer review accepts the refactor.