Repository navigation
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 13, 2026, 11:56 PM ET / September 14, 2026, 03:56 UTC (Revision 2). ClawSweeper reviewWhat this changesMakes memory file reads use the same agent workspace as memory search by sharing legacy-data ownership resolution, while preserving explicit workspace settings and legacy reader behavior. Merge readiness⛔ Blocked before merge - 2 items remain This remains a useful fix: current main and v2026.9.4 still have the divergent workspace rules. The reviewed patch has no actionable correctness findings, and the recorded Gateway proof supports the intended behavior. Priority: P2 Review scores
Verification
How this fits togetherMemory Core searches an agent’s indexed notes and returns file paths and line ranges. The memory-host reader resolves those paths against the agent’s workspace and validates them before returning file contents. flowchart TD
A[Agent configuration] --> B[Workspace ownership]
B --> C[Memory search index]
C --> D[File path and line range]
B --> E[Memory file reader]
D --> E
E --> F[Path containment check]
F --> G[File contents or read error]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +38, Tests +74, Other 0. Total +112 across 6 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: Keep search and reads on one workspace-ownership rule, honoring the recorded compatibility choice and preserving explicit pins and migrated data locations. Do we have a high-confidence way to reproduce the issue? Yes: an explicit two-agent roster with distinct parent and agent USER.md markers exposes the divergent resolvers on current main. This review established the path from source; the PR separately reports failing-before tests and successful candidate Gateway runs. Is this the best way to solve the issue? Yes: sharing the existing legacy-data decision repairs the mismatch without changing runtime-default selection, moving files, or expanding the allowlist. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 65710d3e8bac. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Closing: this work now lives on #147072 itself (the contributor's branch accepts maintainer edits), with the same commits on top of theirs. AI-assisted. |
Problem
Memory search finds an agent's file, but
memory_getreturns the parent's different file as success.Fix and impact
Search and explicit memory reads now share one lightweight legacy-data owner. The two existing cached facts stay with the agent owner. Raw reader behavior, optional IDs, workspace pins, home/profile handling, and extra paths remain supported. No schema, migration, config key, protocol, or dependency changes.
Owner decision: explicit-roster reads must return the searched workspace's file, never a different parent file. This ends the explicit-roster exception retained in #140984. To retain the parent as an agent's workspace, configure that workspace explicitly. Legacy data ownership remains separate from the durable runtime default, preserving #146246.
Production growth is reduced from 46 to 38 net lines:
agent-roster.tsmoves existing roster readers into a lightweight module and owns the shared data decision.agent-scope-config.tsshrinks by 96 lines while preserving public exports and both cache lifetimes.config-utils.tsadds eight net lines to preserve raw-reader compatibility and use the shared owner for explicit inputs.openclaw-runtime-paths.tsadds the one export needed by that call.Evidence
5576f256da61f4708ed59ada7604702a18d8e0fc: the three unpinned regression rows fail withstatus: okandtext: Parent decoy; the pinned control passes. Command:node scripts/run-vitest.mjs extensions/memory-core/src/tools.real-manager.test.ts -t 'reads the indexed agent file with explicit ownership'.a016f35b265a96d4cdfd5d43dbf12d461ae417d2: real GatewayPOST /tools/invoke, search then get, covers both roster orders, a non-first system agent, explicit pins, and parent traversal. Eight reads return the known agent file bytes; eight traversals are rejected.f48cf5fc4eb0e717f252fefde7929632f24d494a, parents candidate above and mainf6d984fcbef0f00cdeee4737d70ababb869f5162: 297 tests pass, one existing skip, across the owner, memory, session/auth, and Doctor suites below.HTTP requests and fresh-merge test command
The isolated Gateway runs through
pnpm openclaw gateway run --port <isolated-port> --bind loopback.{"agentId":"main","tool":"memory_search","args":{"query":"AGENT_MAIN_ORCHID","corpus":"memory"}} {"agentId":"main","tool":"memory_get","args":{"path":"USER.md","from":1,"lines":3}} {"agentId":"main","tool":"memory_get","args":{"path":"../USER.md","from":1,"lines":2}}The search-returned path and line range drive the read. The read returns
# main\nAGENT_MAIN_ORCHID searched source; traversal returnsMEMORY_PATH_NOT_ALLOWED.Supersedes #147072 by @PollyBot13. Thanks to @PollyBot13 for reporting #146939 and contributing the original fix; both contributor commits retain their authorship.