Repository navigation
fix(memory-wiki): scope wiki_status bridgePublicArtifactCount to calling agent - #103196
SunnyShu0925 wants to merge 1 commit into
Conversation
…ing agent
wiki_status and openclaw wiki doctor reported bridgePublicArtifactCount from
all active memory plugins process-wide, without filtering by the caller's
agentId. Each artifact record already carries an agentIds[] field, but
resolveMemoryWikiStatus called listActiveMemoryPublicArtifacts({ cfg }) with
no agent identity, so an agent with zero memory of its own could learn
whether another agent had bridged artifacts.
Fix: thread agentId through createWikiStatusTool (via WikiToolMemoryContext,
matching the sibling wiki_search/wiki_get pattern), pass it to
resolveMemoryWikiStatus, and filter bridgePublicArtifactCount to artifacts
whose agentIds include the caller. Operator/CLI callers omit agentId to
preserve the global count.
Refs: openclaw#103088
Co-Authored-By: deepseek-v4-flash <[email protected]>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
* feat(memory-wiki): isolate per-agent vaults Refs #63829. Co-authored-by: SunnyShu <[email protected]> * fix(memory-wiki): scope agent status metadata Refs #103088 and #103196. Co-authored-by: SunnyShu <[email protected]> --------- Co-authored-by: SunnyShu <[email protected]>
|
Thanks, @SunnyShu0925. The caller-scoped status behavior landed in canonical PR #103349 as That PR also introduced per-agent vault routing across the same entrypoint/status surfaces, so this branch no longer applies cleanly as a separate change. Your artifact-ownership approach was adapted, both landed commits preserve your co-author credit, and the final behavior keeps operator status global while filtering agent-tool status. Closing as superseded by the landed canonical implementation. |
* feat(memory-wiki): isolate per-agent vaults Refs openclaw#63829. Co-authored-by: SunnyShu <[email protected]> * fix(memory-wiki): scope agent status metadata Refs openclaw#103088 and openclaw#103196. Co-authored-by: SunnyShu <[email protected]> --------- Co-authored-by: SunnyShu <[email protected]>
What Problem This Solves
wiki_statusandopenclaw wiki doctorleak the existence of another agent's bridged memory artifacts via an unscoped bridgePublicArtifactCount.resolveMemoryWikiStatuscallslistActiveMemoryPublicArtifacts({ cfg })with no agent identity, sobridgePublicArtifactCountreports every configured agent's artifacts process-wide. An agent with zero memory of its own learns whether another agent has bridge artifacts from the count and the derivedbridge-artifacts-missingwarning.agentIdinto the status resolver and filterbridgePublicArtifactCountby the artifact's existingagentIdsfield. The data needed for scoping already exists on every artifact — only the filter was missing.createWikiStatusToolnow acceptsWikiToolMemoryContext(matching siblingwiki_search/wiki_get), passesagentIdtoresolveMemoryWikiStatus, which filters the artifact count byartifact.agentIds.includes(agentId).openclaw wiki status/doctor(operator tools, no agentId → global count unchanged), gateway methods, bridge sync, plugin SDK, any other tool.Change Type (select all)
Scope (select all)
Linked Issue/PR
Motivation
Multi-agent setups with bridge-enabled memory-wiki leak cross-agent artifact existence metadata through the status/diagnostics path. Each artifact already carries
agentIdsfrom discovery, but the status resolver ignores it and reports the process-wide total.Evidence
Behavior addressed:
wiki_statusagent tool now reportsbridgePublicArtifactCountscoped to the calling agent. Operator CLIwiki doctorremains global.Real environment tested: origin/main commit 8e25c36, Node 22.19.0, Linux (x86_64), extensions/memory-wiki plugin.
Exact steps or command run after this patch:
The new test
filters bridgePublicArtifactCount by calling agentIdcovers 5 scenarios:"main"["main"]+["secondary"]"secondary"["main"]+["secondary"]"third-agent"["main"]+["secondary"]["main"]+["secondary"]"main"["main"]Observed result after fix:
wiki_statussees only its own bridge artifact countbridge-artifacts-missingwarning (previously suppressed by other agents' artifacts)openclaw wiki status/doctor(no agentId) keeps the global count unchangedWhat was not tested: The
memory_get({corpus: "all"})corpus-supplement fallback path; interaction withmemory-lancedbor custom bridge providers (both delegate to the samelistMemoryHostPublicArtifactswhich populatesagentIds); end-to-end gateway routing ofwiki.status.Root Cause (if applicable)
extensions/memory-wiki/src/status.ts:213-223callslistActiveMemoryPublicArtifacts({ cfg })with no agent identity. The derived warning atstatus.ts:164-175inherits the same unscoped total. ThecreateWikiStatusToolattool.ts:117had nomemoryContextparameter to thread a calling-agent id, unlike siblingwiki_search/wiki_get.Regression Test Plan (if applicable)
Added
filters bridgePublicArtifactCount by calling agentIdinstatus.test.tscovering 5 scenarios: own-artifact caller, other-agent caller, no-match caller, undefined agentId (CLI path), and correct warning behavior.User-visible / Behavior Changes
wiki_statustool output:bridgePublicArtifactCountnow reflects only the calling agent's artifactsbridge-artifacts-missingwarning now correctly appears when the calling agent has no artifacts, even if other agents have exported artifactsopenclaw wiki status/doctoroutput: unchangedSecurity Impact (required)
wiki_statusoutput changes (scoped vs global count)Human Verification (required)
Best-fix Verdict
agentIdintolistActiveMemoryPublicArtifactsSDK — would require changing the provider contract for all bridge implementations. The current approach (post-filter at the caller) is minimal and safe.AI Assistance 🤖
Risks and Mitigations
Highest risk area: Third-party bridge providers that do not populate
agentIdson their public artifacts would see those artifacts excluded from any agent-scoped status query. Mitigation: all built-in providers (memory-core,memory-lancedb) delegate tolistMemoryHostPublicArtifactswhich correctly populatesagentIds. The CLI/operator path (no agentId) always returns the global count unaffected.Compatibility: Fully backward-compatible.
agentIdis optional; callers that omit it (CLI operator, gateway, any existing code) get the exact same behavior as before.Fixes #103088