Skip to content

feat(memory): resolve the memory audience in the host - #162176

Merged
jalehman merged 3 commits into
mainfrom
feat/memory-host-audience
Oct 2, 2026
Merged

jalehman merged 3 commits into
mainfrom
feat/memory-host-audience

Conversation

@jalehman

@jalehman jalehman commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Memory providers have to re-derive whether a caller acts for the owner privately or for one conversation, walking spawn lineage through session lookups themselves.

User Impact

When a native memory provider owns the slot, the host resolves a MemoryAudience per turn and hands it to the provider, the provider's own tools, hooks and Codex dynamic tools. Recall never serves one audience's results to another, and openclaw doctor/status report a native provider's health.

When Memory Core or a runtime-only (V1) plugin owns the slot, nothing changes: no audience is minted, there are no lineage reads or leases, no upgrade warning, and unrelated plugin tools are never gated by memory currency.

Upgrade behavior (accepted by maintainer decision below): under a native provider, spawned sessions created before lineage receipts existed get no memory audience. They fail closed, and a warning tells the operator to respawn; respawning restores access. Top-level sessions and Memory Core/V1 installs are unaffected.

Why This Change Was Made

Every spawn producer stamps a trusted lineage receipt. That covers sessions_spawn, sessions.create, ACP, and realtime consults (meeting bot, voice call, FaceTime). Owner status comes only from trusted host facts. The host mints audiences from exact lineage, reading parent rows on the session read worker with a lease on each hop's incarnation.

Audience currency is enforced at every memory boundary:

  • Provider guard: native providers receive an assertCurrent that includes audience currency, checked before and after open().
  • Active Memory: rechecks immediately before publishing prependContext and before caching.
  • Project bootstrap: rechecks after close().
  • The slot owner's own tools: the currency guard wraps only those tools.

Fixes in this revision:

  • Active Memory lane-1 tool policy:
    • Legacy owners keep main's deterministicRecallToolName gate.
    • Native providers require a non-empty recallToolNames declaration, with every declared tool allowed. The SDK guide now documents this.
  • Group-rooted children: children spawned from channel-created rows get their group's conversation audience instead of a spurious legacy warning.
  • Spawn check off the Gateway thread: the parent check before a spawn commits uses the session read worker instead of a synchronous main-thread read. A parent with no stored row spawns as on main.
  • Codex prompt hooks: the Codex app-server now forwards the turn's memory audience and sandbox state into its prompt-hook context, as the built-in runner does, so Active Memory recall works for Codex sessions with a native provider. Before, only Codex dynamic tools received the audience. Covered by run-attempt.prompt-hook-audience.test.ts, which fails without the fix.
  • Cold contexts: native detection works in contexts that loaded the provider earlier, without ever loading plugins for legacy owners.
  • sessions.list unchanged: the spawn receipt is stored in an unprojected spawnedBySessionId field, so main's existing parentSessionId field and its consumers are untouched.

Evidence

Live proof on an isolated Gateway through real entry points, with the real Knowledge plugin as the native provider and a deterministic model. Proof build e57ddfeeaad on main d7fd9a7dea1; it is runtime-identical to the pushed tips. The pushed tips were rebased onto newer main through a mechanical method-list conflict, and protocol:check plus the method-list and memory Gateway tests pass on them.

Results and redacted traces

Build: stack ; candidate e57ddfeeaad (base for upgrade/compat cells: d7fd9a7dea1). Isolated Gateway on its own port, HOME, OPENCLAW_STATE_DIR and OPENCLAW_CONFIG_PATH under a scratch directory, launched with env -i (no provider credentials, no access to the operator's ~/.openclaw).

Harness (real entry points, deterministic model):

  • Turns enter through the Gateway WebSocket chat.send RPC (operator with operator.admin, as the Control UI owner connects) and through the bundled qa-channel plugin polling the repository's QA bus (group conversation, non-owner sender stranger). Children are created by the model calling the real sessions_spawn tool; resets use sessions.reset.
  • The model is a scripted OpenAI-compatible /v1/chat/completions server configured as a normal models.providers entry. It emits the tool calls named in the user message (through the default Tool Search tool_call surface) and can hold a response on a named gate so a reset can land between audience minting and tool dispatch. Admission, tool dispatch, flush planning and compaction are all product code.
  • Memory slot owner: the real Knowledge plugin (feat/provider-neutral-memory, built against this OpenClaw build) with its own store under the isolated state dir. A pass-through tap module loads Knowledge's unmodified entry and records, at the provider boundary, the host-supplied memoryAudience/memoryFlush each provider open/search/get/candidates call and Knowledge tool execution received and whether Knowledge returned or refused. It never changes arguments, results or errors. [provider] lines below come from it; [model#n] lines are what the Gateway sent to the model (including any Active Memory prependContext); [gateway] lines are the Gateway's own file log.
  • Active Memory is enabled for main/direct chats so lane-1 trigger recall (provider.candidates → prependContext) is observable.
  • Excerpts are redacted: paths, users, tokens; session keys keep only their kind; UUIDs become stable labels (<uuid#n>).

Results

# Case Result
1 Owner-direct session reaches provider I/O with owner-private and gets owner records PASS
2 Group conversation (qa-channel, non-owner) gets a conversation audience; owner records absent; no owner-partition I/O PASS
3d A child spawned from a channel-created group row (no lifecycle revision) receives that group's conversation audience; no owner-private access and no respawn warning PASS
3a Spawned child inherits the owner audience through lineage; after the captured ancestor is reset, the child's next turn has no audience, provider I/O is refused and no recall/prependContext is published PASS
3b Ancestor reset after the child's audience was minted but before its tool call: refused before provider I/O PASS
3c Active Memory deep recall in flight in a child when its captured ancestor is reset: no prependContext published (control without reset publishes it) PASS
4 Legacy spawned row (created by the pre-PR build) gets no audience plus the WARN; respawning restores access PASS

1. Owner-direct session

Commands (operator chat.send to main, model directives in the message):

chat.send {sessionKey:"main", message:"@@tool knowledge_save_page {...type:note,title:'Owner launch plan'...}\n@@tool knowledge_grep {query:'Lisbon launch'}\n@@tool knowledge_status {}"}
chat.send {sessionKey:"main", message:"@@tool knowledge_recall {id, expectedRevision:1, expectedHash, set:{summary:'RECALLED-OWNER-SUMMARY…', triggers:['lisbon launch']}}"}
chat.send {sessionKey:"main", message:"Status check on the lisbon launch please."}
[provider] tool knowledge_save_page session=<main-session-key#1> audience=owner-private -> ok: state=published path=notes/owner-launch-plan.md
[provider] tool knowledge_grep session=<main-session-key#1> audience=owner-private -> ok: resultCount=1 titles=["Owner launch plan"]
[provider] tool knowledge_status session=<main-session-key#1> audience=owner-private -> ok: scope=private records=1
[provider] tool knowledge_recall session=<main-session-key#1> audience=owner-private -> ok: state=published path=notes/owner-launch-plan.md
[provider] provider.candidates session=<main-session-key#1> audience=owner-private -> ok: hits=["knowledge:<uuid#1>"]
[model#7] turn tools=(turn surface) prependContext=["- RECALLED-OWNER-SUMMARY: launch city is Lisbon (Source: knowledge:<uuid#1>)"] -> text "PROOF ack"

Decision point: the turn's audience is owner-private; Knowledge resolves the private partition (scope=private), returns the owner record, accepts the owner-only recall approval, and the next owner turn's Active Memory lane-1 lookup publishes the approved summary as prependContext.

2. Conversation isolation (qa-channel group, non-owner)

Command: QA bus POST /v1/inbound/message {conversation:{id:"proof-room",kind:"group"}, senderId:"stranger", text:"…grep / lookup by exact title / record by the owner record id / recall clear / status"}.

[provider] provider.open session=<group-session-key#1> audience=conversation(sessionKey=<group-session-key#1>, sessionId=<uuid#2>) -> ok: ok
[provider] provider.candidates session=<group-session-key#1> audience=conversation(sessionKey=<group-session-key#1>, sessionId=<uuid#2>) -> ok: hits=[] warning="Automatic recall uses only owner-approved private records."
[provider] tool knowledge_grep session=<group-session-key#1> audience=conversation(sessionKey=<group-session-key#1>, sessionId=<uuid#2>) -> ok: resultCount=0 titles=[]
[provider] tool knowledge_lookup session=<group-session-key#1> audience=conversation(sessionKey=<group-session-key#1>, sessionId=<uuid#2>) -> ok: resultCount=0 titles=[] outcome=missing
[provider] tool knowledge_record session=<group-session-key#1> audience=conversation(sessionKey=<group-session-key#1>, sessionId=<uuid#2>) -> ok: record=null
[provider] tool knowledge_recall session=<group-session-key#1> audience=conversation(sessionKey=<group-session-key#1>, sessionId=<uuid#2>) -> refused: Automatic recall approval requires the owner's private memory audience; conversation audiences are not allowed.
[provider] tool knowledge_status session=<group-session-key#1> audience=conversation(sessionKey=<group-session-key#1>, sessionId=<uuid#2>) -> ok: scope=conversation:<uuid#2> records=0
[check] provider I/O entries with an owner-private audience during this case: 0
[model#13] turn tools=(turn surface) prependContext=[] -> text "PROOF tool=tool_call(knowledge_status) result={\n  \"tool\": {\n    \"id\": \"openclaw:knowledge:knowledge_status\",\n    \"name\": \"knowledge_status\",\n    …

Decision point: the group root's durable chatType=group yields a conversation audience bound to that session key and id. Knowledge resolves the conversation partition, so the owner record is absent to search, exact lookup and exact read by id; the owner-only recall tool refuses; no provider call during the case carries an owner-private audience; and no recall summary is injected.

2b. Group-rooted spawned child

Commands: qa-channel group proof-room, non-owner sender stranger: @@tool sessions_spawn {task:'GROUPCHILD ready\n@@tool knowledge_grep {…}\n@@tool knowledge_status {}'}.

[provider] tool knowledge_grep session=<subagent-session-key#1> audience=conversation(sessionKey=<group-session-key#1>, sessionId=<uuid#2>) -> ok: resultCount=0 titles=[]
[provider] tool knowledge_status session=<subagent-session-key#1> audience=conversation(sessionKey=<group-session-key#1>, sessionId=<uuid#2>) -> ok: scope=conversation:<uuid#2> records=0
[check] owner-private provider I/O during this case: 0; lineage-receipt warnings: 0

3. Lineage, then reset of a captured ancestor

3a. Child inherits, ancestor reset, next child turn

Commands: chat.send main "@@tool sessions_spawn {task:'CHILD-A…\n@@tool knowledge_grep {…}', cleanup:'keep'}", then sessions.reset {key:<main-session-key>}, then chat.send <child> "Status check on the lisbon launch please.\n@@tool knowledge_grep {…}".

Before the reset (child turn):

[provider] tool knowledge_grep session=<subagent-session-key#2> audience=owner-private -> ok: resultCount=1 titles=["Owner launch plan"]
[model#21] turn tools=(turn surface) prependContext=["- RECALLED-OWNER-SUMMARY: launch city is Lisbon (Source: knowledge:<uuid#1>)"] -> tool_call knowledge_grep

After the reset (child turn):

[gateway DEBUG] memory audience unavailable: session <main-session-key#1> is missing or no longer matches its recorded lineage
[provider] provider.open session=<subagent-session-key#2> audience=none -> refused: Knowledge access unavailable: trusted agent/session authority is required.
[provider] tool knowledge_grep session=<subagent-session-key#2> audience=none -> refused: Knowledge access unavailable: trusted agent/session authority is required.
[model#23] turn tools=(turn surface) prependContext=["Active Memory intentionally skipped deep recall because this turn did not ask for past context."] -> tool_call knowledge_grep
[model#24] turn tools=(turn surface) prependContext=["Active Memory intentionally skipped deep recall because this turn did not ask for past context."] -> text "PROOF tool=tool_call(knowledge_grep) result={\n  \"status\": \"error\",\n  \"tool\": \"tool_call\",\n  \"error\": \"Knowledge access unavailable: trusted agent…

Decision point: lineage resolution re-reads the parent row and finds the recorded parent incarnation gone, so no audience is minted. Knowledge refuses both the Active Memory provider open and the tool (no partition is opened), and the prompt carries only Active Memory's "skipped" note, not the owner summary.

3b. Reset lands between audience minting and the tool call

Commands: spawn CHILD-C; chat.send <child> "…\n@@gate childc\n@@tool knowledge_grep {…}" (model holds its first response); sessions.reset {key:<main-session-key>}; release the gate.

While held (audience already minted for the child turn):

[provider] provider.open session=<subagent-session-key#3> audience=owner-private -> ok: ok
[provider] provider.search session=<subagent-session-key#3> audience=owner-private -> ok: hits=[] warning="Current eligible scoped records only. Ranked search is not exhaustive vault listing."
[provider] provider.candidates session=<subagent-session-key#3> audience=owner-private -> ok: hits=["knowledge:<uuid#1>"]
[model#28] turn tools=(turn surface) prependContext=["- RECALLED-OWNER-SUMMARY: launch city is Lisbon (Source: knowledge:<uuid#1>)"] -> tool_call knowledge_grep
[model] gate-wait gate=childc

After the ancestor reset and release:

[model] gate-release gate=childc
[model#29] turn tools=(turn surface) prependContext=["- RECALLED-OWNER-SUMMARY: launch city is Lisbon (Source: knowledge:<uuid#1>)"] -> text "PROOF tool=tool_call(knowledge_grep) result={\n  \"status\": \"error\",\n  \"tool\": \"tool_call\",\n  \"error\": \"memory audience is no longer current\"\n}"
[gateway ERROR] [tools] tool_call failed: memory audience is no longer current raw_params={"id":"knowledge_grep","args":{"query":"Lisbon launch"}}
[check] provider I/O entries for the child after the ancestor reset: 0

Decision point: the host's plugin-tool invocation guard (bindPluginToolCallbacks → the tool factory context's assertInvocationCurrent) calls assertMemoryAudienceCurrent before the plugin's execute; the parent's generation lease is revoked, so the call fails with memory audience is no longer current before Knowledge's tool body runs (the tap records no execution). Note that a reset of the spawning parent aborts an in-flight spawn task outright (AbortError taskKind=spawn), so this case uses a continuation turn in the child, which the parent reset does not abort.

3c. Active Memory recall in flight when the captured ancestor is reset

Commands: spawn CHILD-E; positive control chat.send <child> "What did we decide previously about the venue?"; then with the scripted model holding the deep-recall sub-agent's final summary (POST /control {recallGate}, released after its knowledge_grep returned), chat.send <child> "Do you remember what we discussed earlier about the venue?", sessions.reset {key:<main-session-key>}, release.

Positive control (no reset): the deep-recall summary is published to the child's turn:

[model#33] active-recall tools=["tool_call","tool_describe","tool_search"] prependContext=[] -> tool_call knowledge_grep
[model#34] active-recall tools=["tool_call","tool_describe","tool_search"] prependContext=[] -> text "RECALLED-DEEP-SUMMARY: the owner plans the Lisbon launch"
[model#35] turn tools=(turn surface) prependContext=["RECALLED-DEEP-SUMMARY: the owner plans the Lisbon launch"] -> text "PROOF ack"

Held (recall sub-agent searched with the child's inherited audience; its summary is pending):

[provider] provider.open session=<subagent-session-key#4> audience=owner-private -> ok: ok
[provider] tool knowledge_grep session=<subagent-session-key#5> audience=owner-private -> ok: resultCount=1 titles=["Owner launch plan"]
[model] (harness control {"flushGate":null,"recallGate":"amg"})
[model#36] active-recall tools=["tool_call","tool_describe","tool_search"] prependContext=[] -> tool_call knowledge_grep
[model#37] active-recall tools=["tool_call","tool_describe","tool_search"] prependContext=[] -> text "RECALLED-DEEP-SUMMARY: the owner plans the Lisbon launch"
[model] gate-wait gate=amg

After the ancestor reset and release:

[model] gate-release gate=amg
[model#38] turn tools=(turn surface) prependContext=[] -> text "PROOF ack"
[gateway INFO] active-memory: agent=main session=<subagent-session-key#4> activeProvider=proof activeModel=proof-model thinking=off fast=off done status=ok elapsedMs=1129 summaryChars=56
[gateway WARN] active-memory: agent=main session=<subagent-session-key#4> activeProvider=proof activeModel=proof-model thinking=off fast=off failed error=memory audience is no longer current; skipping recall
[gateway INFO] active-memory: agent=main session=<subagent-session-key#4> activeProvider=proof activeModel=proof-model thinking=off fast=off done status=failed elapsedMs=1131 summaryChars=0

Decision point: the recall sub-agent still finishes (done status=ok summaryChars=…), but Active Memory rechecks the turn's audience currency immediately before publishing; the parent incarnation captured by the child's audience is gone, so nothing is published to the child's turn (no deep summary, no lane-1 summary).

4. Legacy spawned row (upgrade)

Commands: base build d7fd9a7dea1: chat.send main "@@tool sessions_spawn {task:'LEGACY-CHILD ready', cleanup:'keep'}"; stop. Candidate build on the same state dir with Knowledge selected: owner saves a record; chat.send <legacy child> "@@tool knowledge_grep {…}"; then chat.send main "@@tool sessions_spawn {task:'RESPAWNED-CHILD\n@@tool knowledge_grep {…}'}".

Spawned by the pre-PR build:

[model#1] turn tools=(turn surface) prependContext=[] -> tool_call sessions_spawn
[model#2] turn tools=(turn surface) prependContext=[] -> text "PROOF tool=tool_call(sessions_spawn) result={\n  \"tool\": {\n    \"id\": \"openclaw:core:sessions_spawn\",\n    \"name\": \"sessions_spawn\",\n    \"source\":…
[model#3] turn tools=(turn surface) prependContext=[] -> text "PROOF ack"

Legacy child on the candidate:

[gateway WARN] memory audience unavailable: spawned session <subagent-session-key#6> predates memory lineage receipts (spawnedBySenderIsOwner), so it has no inherited memory audience. Respawn it from its parent session to restore memory access.
[provider] tool knowledge_grep session=<subagent-session-key#6> audience=none -> refused: Knowledge access unavailable: trusted agent/session authority is required.

Respawned child:

[provider] tool knowledge_grep session=<subagent-session-key#7> audience=owner-private -> ok: resultCount=1 titles=["Owner launch plan"]

Decision point: the row has spawnedBy but neither spawnedBySenderIsOwner nor parentSessionLifecycleRevision, so resolution denies with the operator-visible WARN and Knowledge refuses. A child respawned by the candidate carries the receipts and gets the owner audience back.

Case 10 (partial tool policy), same build: with one of Knowledge's declared recall tools denied by tool policy, Active Memory made 0 trigger lookups and injected nothing. The control run made 2 lookups and injected the recalled summary once.

Regression tests (real SQLite, worker reads and leases where lineage is involved), each failing before its fix:

  • provider guard refused after a mid-call reset
  • conversation isolation
  • no publish or cache after the audience goes stale
  • project bootstrap returning no lines when stale
  • delegate bound to the child's incarnation
  • legacy-row respawn instruction
  • group-rooted child audience
  • spawn parent recheck without a synchronous read
  • lineage receipts on ACP and consult spawns
  • native/legacy detection in cold contexts

Gates on the final tree:

  • all tsgo lanes, check:architecture, protocol:check, plugin-sdk checks, docs:check-mdx and focused vitest (48 files): pass
  • test consolidation (test(memory): consolidate memory audience tests, tests only): removed duplicate and implementation-mirroring cases (−261 test lines, two fewer test files). The 10 affected files pass locally; the tsgo core-test and extensions-test lanes pass on Testbox.
  • check-changed: lint fails only on inherited max-lines errors in files with identical counts on main

Differential compatibility vs main for Memory Core and V1 configurations: no differences outside #162175's intended list.

Inherited CI failures

CI on ac370e8edd5 failed one test that was this PR's: src/talk/agent-consult-runtime.test.ts strictly compared the consult child's session entry, which now intentionally carries the parent's lineage receipt. a3c9bbdfc24 fixes it, and that test passes in CI on a3c9bbdfc24.

CI on a3c9bbdfc24 fails 4 shards, none caused by this PR. It touches none of these files, and main has no later change to them.

Shard Test Evidence
compact-large-33-2 src/plugins/host-hook-cleanup.session-store.test.ts, two cases (SQLite file bytes differ after cleanup) Fails identically on this PR's base 0dc63eecadd (main with #162175) in a clean worktree: 2 failed, 18 passed.
compact-small-12-2 src/gateway/server-methods/sessions-list-persisted-worker.test.ts ("Auth profile read owner was revoked") Fails identically on base 0dc63eecadd in a clean worktree: 1 failed, 2 passed.
compact-small-8-1 src/config/sessions/conversation-registry.test.ts (database is locked) Fails identically on base 0dc63eecadd in a clean worktree: the same 2 cases.
compact-large-19-1 src/gateway/github-repository-publication-restart.test.ts (database is locked) Failed on both CI heads, but passes locally on this PR's commit and on the base (6/6). This PR doesn't touch GitHub publication.

As on #162175, these are agent-database lifecycle and locking failures currently on main.

@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime extensions: memory-core Extension: memory-core commands Command implementations agents Agent runtime and tooling extensions: memory-wiki extensions: codex extensions: active-memory size: XL labels Sep 30, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 30, 2026
@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 2, 2026, 6:12 PM ET / 22:12 UTC (Revision 13).

ClawSweeper review

What this changes

The host determines each turn’s private or conversation memory access, carries it through memory providers, tools and hooks, and reports native provider health.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains distinct, useful work beyond the merged provider runtime. Earlier findings are resolved, and the recorded interface and upgrade decisions cover the current change; no new blocking defect was identified.

Priority: P2
Reviewed head: a3c9bbdfc24b4bc86afa554d6d36f3cdfb772c75

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong production-path isolation and revocation proof supports a coherent patch with no remaining concrete review finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The hash-matched full body records isolated-Gateway turns through real admission, spawn, reset, provider and recall owners: owner access succeeds, groups cannot read private records, ancestor revocation prevents tool I/O and stale prompt publication. Older-state denial and respawn recovery, plus legacy differential checks, support the accepted additive lineage contract.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): The hash-matched full body records isolated-Gateway turns through real admission, spawn, reset, provider and recall owners: owner access succeeds, groups cannot read private records, ancestor revocation prevents tool I/O and stale prompt publication. Older-state denial and respawn recovery, plus legacy differential checks, support the accepted additive lineage contract.
Evidence reviewed 11 items Pinned introduction and review continuity: Reviewed the introduced delta from 0dc63ee to a3c9bbd. The change since the previous reviewed head only adds lineage expectations to two consult-session tests; it introduces no new production or configuration behavior.
Still necessary on current main: Fetched main still supplies senderIsOwner/chatType on session memory authority and has no host memory-audience resolver at the added path. The merged prerequisite #162175 supplies the provider runtime, not this audience lifecycle.
Release boundary: The new memory-audience source path is absent from both fetched main and the supplied latest release, v2026.9.7; no merged fixing PR establishes that this request is already implemented.
Findings None None.
Security None None.

How this fits together

OpenClaw’s memory subsystem supplies recalled information to agent turns. The host uses trusted sender facts and stored parent-session lineage to determine which memory a provider may expose.

flowchart TD
  A[Trusted agent turn] --> B[Selected memory provider]
  B --> C[Legacy memory path]
  B --> D[Validate session lineage]
  D --> E[Private or conversation audience]
  E --> F[Provider and tool currency guards]
  F --> G[Memory results and prompt recall]
Loading

Before merge

  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test growth production +1345 net lines; tests and test support +2416 net lines Production growth implements the stated host authority lifecycle and its consumer cutover; regression coverage accounts for most net growth.
Durable lineage receipt 3 optional session fields; no SQL DDL These fields carry parent incarnation and owner facts, with an explicitly accepted and demonstrated older-row recovery path.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/gateway/server-methods/doctor-memory-provider-status.ts, migration/backfill/repair: src/gateway/server-methods/doctor-memory-target.ts, migration/backfill/repair: src/gateway/server-methods/doctor.ts, unknown-data-model-change: src/gateway/server-methods/doctor-memory-provider-status.ts, unknown-data-model-change: src/gateway/server-methods/doctor-memory-target.ts, unknown-data-model-change: src/gateway/server-methods/doctor.ts, and 8 more. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Technical review

Best possible solution:

Keep memory partition selection and revocation with the host, while providers enforce visibility using the supplied live audience and legacy providers retain their established behavior.

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

Not applicable as a feature request; the supplied runtime traces directly exercise the new memory audience behavior and its rejection cases.

Is this the best way to solve the issue?

Yes. Centralizing audience resolution and currency with the host avoids competing provider-side authority logic, and the recorded decisions cover the interface and upgrade tradeoff.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 99f1f78b6bcf.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded memory-provider capability improvement without evidence of an urgent current-user outage.
  • merge-risk: 🚨 compatibility: The accepted interface and older-child fail-closed behavior affect native providers; upgrade denial and respawn recovery are documented and demonstrated.
  • merge-risk: 🚨 security-boundary: Audiences delegate private-memory authority across sessions; inspected guards and runtime traces cover conversation isolation and revocation before effects.
  • 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 (logs): The hash-matched full body records isolated-Gateway turns through real admission, spawn, reset, provider and recall owners: owner access succeeds, groups cannot read private records, ancestor revocation prevents tool I/O and stale prompt publication. Older-state denial and respawn recovery, plus legacy differential checks, support the accepted additive lineage contract.
  • proof: sufficient: Contributor real behavior proof is sufficient. The hash-matched full body records isolated-Gateway turns through real admission, spawn, reset, provider and recall owners: owner access succeeds, groups cannot read private records, ancestor revocation prevents tool I/O and stale prompt publication. Older-state denial and respawn recovery, plus legacy differential checks, support the accepted additive lineage contract.

Evidence

What I checked:

Likely related people:

  • Josh Lehman: Raw commit 0dc63ee adds src/plugins/memory-runtime.ts:322 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 0dc63eecaddd; files: src/plugins/memory-runtime.ts)
  • Peter Steinberger: Raw commit 50b3415 adds src/config/sessions/session-delivery-generation.ts:396 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 50b3415dba9e; files: src/config/sessions/session-delivery-generation.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-01T21:14:19.889Z sha 2538b39 :: blocked before merge. :: none
  • reviewed 2026-10-01T23:19:38.405Z sha d26746c :: needs real behavior proof before merge. :: [P1] [P1] Preserve the deterministic recall tool’s permission check
  • reviewed 2026-10-02T06:21:50.326Z sha b539626 :: needs real behavior proof before merge. :: [P3] [P3] Document the native trigger-recall permission gate
  • reviewed 2026-10-02T12:15:15.433Z sha 70f9b8e :: blocked before merge. :: none
  • reviewed 2026-10-02T18:23:31.264Z sha 56e5fb1 :: blocked before merge. :: [P2] Forward the audience into Codex prompt-hook context
  • reviewed 2026-10-02T20:36:44.062Z sha 56e5fb1 :: blocked before merge. :: [P2] Forward the audience into Codex prompt-hook context
  • reviewed 2026-10-02T20:48:19.661Z sha 52357e4 :: blocked before merge. :: none
  • reviewed 2026-10-02T21:35:39.395Z sha ac370e8 :: blocked before merge. :: none

@jalehman
jalehman force-pushed the feat/memory-provider-runtime branch from 7eea7b5 to d6608bb Compare October 1, 2026 03:10
@jalehman
jalehman force-pushed the feat/memory-host-audience branch from 1e94828 to 579d7df Compare October 1, 2026 03:10
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Oct 1, 2026
@jalehman
jalehman force-pushed the feat/memory-host-audience branch from 579d7df to a58687c Compare October 1, 2026 14:16
@jalehman
jalehman force-pushed the feat/memory-provider-runtime branch from d6608bb to 3e6aa3b Compare October 1, 2026 14:16
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 1, 2026
@jalehman
jalehman force-pushed the feat/memory-host-audience branch from a58687c to 2538b39 Compare October 1, 2026 20:42
@jalehman
jalehman force-pushed the feat/memory-provider-runtime branch from 3e6aa3b to 9b89d7a Compare October 1, 2026 20:42
@openclaw-barnacle openclaw-barnacle Bot removed channel: voice-call Channel integration: voice-call extensions: xai labels Oct 2, 2026
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 2, 2026
Fold the real session-owner audience test into the shared real-lineage
fixture, drop the spawn lineage unit test that the real-SQLite spawn tests
already cover, share spawn parameters, and remove cases that only mirrored
implementation (log text, mock passthrough, per-kind passthrough).
@jalehman
jalehman merged commit a9f6758 into main Oct 2, 2026
174 of 182 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation extensions: active-memory extensions: codex extensions: memory-core Extension: memory-core extensions: memory-wiki gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

1 participant