Skip to content

fix(memory-wiki): tolerate public artifacts without agent ids#92897

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
yu-xin-c:codex/92207-memory-wiki-agentids
Jun 14, 2026
Merged

fix(memory-wiki): tolerate public artifacts without agent ids#92897
vincentkoc merged 1 commit into
openclaw:mainfrom
yu-xin-c:codex/92207-memory-wiki-agentids

Conversation

@yu-xin-c

@yu-xin-c yu-xin-c commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Fixes #92207

Summary

  • Normalize memory public artifacts at the host boundary so legacy providers that omit agentIds produce an empty agent list instead of throwing.
  • Add regression coverage for listActiveMemoryPublicArtifacts and the memory-wiki bridge sync path.

Real behavior proof

Behavior addressed: memory-wiki bridge imports no longer crash when a public memory artifact omits agentIds.
Real environment tested: local OpenClaw source checkout on macOS, running the actual memory-wiki bridge sync against a temporary workspace and temporary bridge vault with a legacy memory provider that omits agentIds; no Vitest test harness for this proof.
Exact steps or command run after this patch: ran ./node_modules/.bin/tsx -e '...' to create a temp workspace containing MEMORY.md, register a memory public-artifact provider that returns the artifact without agentIds, and call syncMemoryWikiBridgeSources with bridge mode enabled.
Evidence after fix: live terminal output from that local OpenClaw setup after this patch:

{
  "importedCount": 1,
  "artifactCount": 1,
  "workspaces": 1,
  "pagePath": "sources/bridge-workspace-0c64b7ec-memory-2d62c497.md",
  "titleLine": "# Memory Bridge: MEMORY",
  "agentsLine": "- Agents: unknown",
  "threwAgentIdsIterableError": false
}

Observed result after fix: the bridge imported the public memory artifact, rendered the bridge source page with unknown agents, and did not throw artifact.agentIds is not iterable.
What was not tested: a live Windows gateway session calling every wiki_* tool; this PR covers the shared bridge sync path that caused the reported crash.

Verification

  • node scripts/run-vitest.mjs src/plugins/memory-state.test.ts -t "normalizes public memory artifacts without agent ids"
  • node scripts/run-vitest.mjs extensions/memory-wiki/src/bridge.test.ts -t "imports bridge artifacts from legacy providers without agent ids"
  • node scripts/run-vitest.mjs src/plugins/memory-state.test.ts extensions/memory-wiki/src/bridge.test.ts
  • ./node_modules/.bin/oxfmt --check --threads=1 src/plugins/memory-state.ts src/plugins/memory-state.test.ts extensions/memory-wiki/src/bridge.test.ts
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/plugins/memory-state.ts src/plugins/memory-state.test.ts
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.extensions.json extensions/memory-wiki/src/bridge.test.ts
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.core.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core-test.tsbuildinfo
  • node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions-test.tsbuildinfo
  • git diff --check -- src/plugins/memory-state.ts src/plugins/memory-state.test.ts extensions/memory-wiki/src/bridge.test.ts

@openclaw-barnacle openclaw-barnacle Bot added triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. extensions: memory-wiki size: S labels Jun 14, 2026
@clawsweeper

clawsweeper Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 14, 2026, 2:30 AM ET / 06:30 UTC.

Summary
The branch changes src/plugins/memory-state.ts to normalize missing or non-array artifact.agentIds to [] and adds memory-state plus memory-wiki bridge regression coverage.

PR surface: Source +1, Tests +70. Total +71 across 3 files.

Reproducibility: yes. at source level: register a memory capability whose listArtifacts returns a memory artifact without agentIds, then call listActiveMemoryPublicArtifacts or syncMemoryWikiBridgeSources. I did not execute tests because this review was read-only, but current main’s spread of artifact.agentIds is a direct failing path.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: extensions/memory-wiki/src/bridge.test.ts, vector/embedding metadata: extensions/memory-wiki/src/bridge.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • [P2] No repair lane is needed because this open PR already contains the narrow implementation, regression tests, and sufficient after-fix proof; maintainer action is to choose and land one canonical duplicate-cluster PR.

Security
Cleared: The diff only changes a small runtime normalization and tests; it does not touch dependencies, workflows, secrets, package metadata, or code-execution surfaces.

Review details

Best possible solution:

Land one canonical fix that normalizes missing agentIds at the memory public-artifact host boundary, then close the duplicate sibling PRs and the linked issue after merge.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level: register a memory capability whose listArtifacts returns a memory artifact without agentIds, then call listActiveMemoryPublicArtifacts or syncMemoryWikiBridgeSources. I did not execute tests because this review was read-only, but current main’s spread of artifact.agentIds is a direct failing path.

Is this the best way to solve the issue?

Yes. Normalizing once in listActiveMemoryPublicArtifacts is narrower and safer than adding separate bridge/status guards, and less broad than making unrelated artifact fields optional.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 462c076a24e2.

Label changes

Label changes:

  • add P1: The PR addresses a user-facing regression where memory-wiki tools can crash for affected users when public memory artifacts omit agent ids.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes structured after-fix terminal output from a local source checkout running the actual bridge sync path with a legacy provider omitting agentIds, and the output shows the artifact imported without the iterable error.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes structured after-fix terminal output from a local source checkout running the actual bridge sync path with a legacy provider omitting agentIds, and the output shows the artifact imported without the iterable error.

Label justifications:

  • P1: The PR addresses a user-facing regression where memory-wiki tools can crash for affected users when public memory artifacts omit agent ids.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes structured after-fix terminal output from a local source checkout running the actual bridge sync path with a legacy provider omitting agentIds, and the output shows the artifact imported without the iterable error.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes structured after-fix terminal output from a local source checkout running the actual bridge sync path with a legacy provider omitting agentIds, and the output shows the artifact imported without the iterable error.
Evidence reviewed

PR surface:

Source +1, Tests +70. Total +71 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 1 +1
Tests 2 70 0 +70
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 72 1 +71

What I checked:

  • Repository policy read: Root AGENTS.md and scoped extensions/AGENTS.md plus src/plugins/AGENTS.md were read fully; their plugin boundary guidance supports fixing this in the shared memory public-artifact host path rather than a bridge-only workaround. (AGENTS.md:1, 462c076a24e2)
  • Current main crash path: Current main clones public memory artifacts with agentIds: [...artifact.agentIds], so an artifact missing agentIds throws before bridge/status consumers can handle it. (src/plugins/memory-state.ts:303, 462c076a24e2)
  • PR head fix location: The PR changes cloneMemoryPublicArtifact to use Array.isArray(artifact.agentIds) ? artifact.agentIds : [], so downstream sorting and bridge rendering receive a stable array. (src/plugins/memory-state.ts:306, 1aa30f842d4d)
  • Bridge consumer path: syncMemoryWikiBridgeSources reads listActiveMemoryPublicArtifacts, builds agentIdsByWorkspace, and renders unknown agents when the normalized list is empty, so the host-boundary normalization covers the reported bridge import path. (extensions/memory-wiki/src/bridge.ts:227, 462c076a24e2)
  • Sibling consumer path: resolveMemoryWikiStatus also calls listActiveMemoryPublicArtifacts, which is another reason the shared host helper is a better fix point than only guarding the bridge map. (extensions/memory-wiki/src/status.ts:207, 462c076a24e2)
  • PR regression tests: The PR adds one direct memory-state test for artifacts without agentIds and one bridge sync test that imports such an artifact and renders - Agents: unknown. (src/plugins/memory-state.test.ts:209, 1aa30f842d4d)

Likely related people:

  • steipete: Recent commits touched both src/plugins/memory-state.ts and extensions/memory-wiki/src/bridge.ts, including memory registration refactors and bridge source sync state work. (role: recent area contributor; confidence: high; commits: 0cf51b77fb69, a4236bd6faf6, 96e581242605; files: src/plugins/memory-state.ts, extensions/memory-wiki/src/bridge.ts)
  • brokemac79: Authored the recent fix(memory): preserve sidecar capability hooks change that modified memory capability registration and added adjacent public-artifact coverage. (role: recent adjacent contributor; confidence: medium; commits: e6288cab9a45; files: src/plugins/memory-state.ts, src/plugins/memory-state.test.ts)
  • mara-mindless: Authored a recent memory-wiki bridge pruning fix in the same syncMemoryWikiBridgeSources function and linked bridge behavior area. (role: adjacent bridge behavior contributor; confidence: medium; commits: 7f5789575e07; files: extensions/memory-wiki/src/bridge.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels Jun 14, 2026
@yu-xin-c
yu-xin-c marked this pull request as ready for review June 14, 2026 06:25
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 High-priority user-facing bug, regression, or broken workflow. labels Jun 14, 2026
@vincentkoc vincentkoc self-assigned this Jun 14, 2026
@vincentkoc
vincentkoc force-pushed the codex/92207-memory-wiki-agentids branch from 1aa30f8 to 19678ed Compare June 14, 2026 12:14
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 14, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer closeout for current head 19678ed60f79778f407700dc35f675cde0357054:

  • Reviewed the memory public-artifact host boundary, memory-wiki bridge import/render path, and sibling status/consumer path. This is the right fix point: normalize once before sorting/cloning artifacts instead of adding bridge-only guards.
  • Best-fix verdict: best narrow compatibility fix. Missing agentIds is treated as an empty public artifact agent list, so bridge output renders Agents: unknown and downstream consumers still receive a stable array.
  • Local focused proof: node scripts/run-vitest.mjs src/plugins/memory-state.test.ts extensions/memory-wiki/src/bridge.test.ts --maxWorkers=1 — 2 shards passed, 26 tests passed.
  • Auto review: .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main — clean, no accepted/actionable findings.
  • Crabbox changed gate: run_2a30de5d0a00 / cbx_3684cb0b7ea5 on Azure — OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 corepack pnpm check:changed, exit 0.
  • GitHub PR checks on 19678ed60f79778f407700dc35f675cde0357054: 133 pass, 24 skipped, 1 neutral CodeQL summary. Merge state is CLEAN.

Landing as the canonical fix for #92207.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: memory-wiki P1 High-priority user-facing bug, regression, or broken workflow. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(memory-wiki): guard against missing agentIds

2 participants