Repository navigation
feat(memory): Drop preference extraction for multi-actor runs - #788
Merged
Merged
Conversation
Passive memory extraction must never store a personal preference from a run that has more than one run actor. Multi-actor turns interleave first-person statements from different people, so a mis-cited preference is where cross-actor personal writes are most costly; a personal preference can wait for a single-actor run. Gate this in two layers. The deterministic routing gate now takes run identity (run.actor plus run.actors) and allows the personal target only for a run with exactly one run actor whose citations are all run-actor instructions; an empty actor set (system runs) fails closed to drop. The extraction agent derives its allowed kind set from run.actors and, on multi-actor runs, omits the preference kind and preference rules from the prompt while adding an explicit no-personal block. The routing gate is kept alongside the prompt gate because cached extraction output can replay preference proposals cached before this gate existed. Refs GH-776 Co-Authored-By: Claude Fable 5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fcc7d3d. Configure here.
…enance A pending message batched into another actor's fresh turn was committed to the session log as unattributed context: the reply executor resolved each queued explicit mention with its author's instruction provenance, then merged only the bare Pi messages into prompt history and dropped the provenance. The fresh-turn checkpoint stamped only the live actor's prompt, so the batched author never joined run.actors and multi-actor consumers (such as the memory plugin's preference gate) saw a single-actor run. Make the drain the commit point, per the specs/multi-actor-runs.md Membership Rule: the fresh-turn path now durably appends each batched message to the session log with its own author's instruction provenance before the run starts, through the same lock-and-dedupe helper the parked-resume path uses, then merges the same messages into the transcript. The fresh-prompt checkpoint matches them as an already-committed prefix and reuses that provenance. piMessages stays the single transcript channel into a run, and the dedupe also stops redeliveries from duplicating batched messages in the log. When a live resume holds the session-log lock, the turn defers so the mailbox redelivers it rather than running with the batch uncommitted. Add the eval acceptance case: the run actor's own well-cited preference stated in a batched multi-actor turn must not be stored as any memory kind. Refs GH-776 Co-Authored-By: Claude Fable 5 <[email protected]>
dcramer
force-pushed
the
feat/memory-multi-actor-preference-gate
branch
from
July 8, 2026 06:22
fcc7d3d to
54f4ee9
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Passive memory extraction no longer stores personal
preferencememories from runs with more than one run actor, even when every evidence citation points at a run-actor instruction. Multi-actor turns interleave first-person statements from different people, so a model mis-cite there is exactly where a cross-actor personal write is most costly; a genuine preference can wait for a single-actor run to restate it. Single-actor passive extraction, explicit memory tools, and supersession are unchanged.The memory gate has two layers:
routeExtractedMemoryreceives run identity (run.actor+run.actors) and routes to the personal target only for a run with exactly one run actor whose citations are all run-actor instructions. Anything else — including an empty actor set on system runs — fails closed to drop, never a downgrade to conversation scope.run.actors: on multi-actor runs the prompt omits the preference kind and rules entirely and adds an explicit block forbidding the laundering of first-person statements intoknowledge/procedure. The deterministic gate stays anyway because extraction output is cached in task state for 7 days and retries can replay proposals cached before the gate existed.The branch also fixes the chat runtime bug that made this gate unreachable in its motivating scenario. A pending message batched into another actor's fresh turn was committed to the session log as unattributed context: the reply executor resolved each queued explicit mention with its author's instruction provenance, then dropped that provenance when merging the bare Pi messages into prompt history, so the fresh-turn checkpoint stamped only the live actor's prompt and the batched author never joined
run.actors. The fix makes the drain the commit point, per thespecs/multi-actor-runs.mdMembership Rule: the fresh-turn path durably appends each batched message to the session log with its own author's instruction provenance before the run starts — through the same lock-and-dedupe helper the parked-resume path already uses — then merges the same messages into the transcript, where the fresh-prompt checkpoint matches them as an already-committed prefix.piMessagesstays the single transcript channel into a run (no new run-input fields), the dedupe also stops redeliveries from duplicating batched messages in the log, and a busy session-log lock defers the turn back to the mailbox instead of running with the batch uncommitted.Review order: the runtime fix is contained to
chat/runtime/reply-executor.ts; then the memory gate (junior-memory), then the eval. The new eval case is the acceptance test for the pair: the run actor's own well-cited preference stated in a batched multi-actor turn must not be stored under any memory kind — it fails on the gate alone without the runtime fix. The other multi-actor provenance cases guard against over-tightening (non-actor operational knowledge still stores as conversation memory), and integration tests cover the committed per-author provenance, the lock-busy deferral, and redelivery dedupe at the durable log boundary.Known flake: the pre-existing batched-mention case's rubric can conflate the two users in reply phrasing because the eval harness renders every profile as the same display name; its DB assertions are stable. Harness display identity is worth a follow-up.
Fixes #776