Skip to content

Keep delegation pipeline-entries sibling-only - #330

Merged
tylerreckart merged 6 commits into
mainfrom
fix/pipeline-entries-exact-conversation
Sep 21, 2026
Merged

tylerreckart merged 6 commits into
mainfrom
fix/pipeline-entries-exact-conversation

Conversation

@cursor

@cursor cursor Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The orchestrator seeds sub-agents with a pipeline-entries snapshot so they can see what siblings just wrote via /mem add. The handler sets EntryFilter.conversation_id and comments that this must stay conversation-scoped (it already returns empty when there is no conversation, rather than dumping tenant-wide history).

list_entries still applies an OR-NULL fallback: conversation_id = ? OR conversation_id IS NULL. That is correct for agent /mem browse and HTTP list (pre-migration / unscoped rows stay visible). It is wrong for this probe.

HTTP POST /v1/memory and CLI /mem add with no conversation write conversation_id NULL. Those rows then appear in the sibling snapshot and are paraphrased as fresh pipeline output. Post-filtering after LIMIT 15 is not a fix: a flood of unscoped rows can hide the actual sibling entries.

Fix

Add EntryFilter.exact_conversation. When set, both the browse and FTS paths use conversation_id = ? only. pipeline-entries opts in. Default list behavior is unchanged.

Tests

unit_memory_entries — exact filter excludes unscoped and other-conversation rows; LIMIT over a flood of unscoped rows still returns the sibling; FTS path uses the same predicate.

Independently mergeable against main. Touches EntryFilter / list_entries SQL (different hunks from #322's list_conversations cursor) plus api_server.cpp pipeline-entries and CHANGELOG [Unreleased]. Rebase CHANGELOG after whichever sibling merges first.

Open in Web View Automation 

Note

Low Risk
Scoped SQL filter change behind an opt-in flag on one orchestration probe; default memory list/search semantics are unchanged.

Overview
Fixes delegation pipeline-entries context bleeding unscoped memory into sub-agent snapshots.

Adds EntryFilter.exact_conversation. When set with a positive conversation_id, list_entries (browse and FTS) uses conversation_id = ? only instead of the usual OR-NULL fallback that keeps HTTP /v1/memory and CLI /mem add rows visible everywhere. The orchestrator pipeline-entries probe opts in so siblings only see conversation-pinned /mem add output; default /mem browse and HTTP list behavior is unchanged.

Tests cover exclusion of unscoped/other-conversation rows, LIMIT under unscoped floods, and the FTS path.

Reviewed by Cursor Bugbot for commit 50d4e51. Bugbot is set up for automated code reviews on this repo. Configure here.

The orchestrator snapshot used list_entries with conversation_id set,
but that filter ORs in NULL-scoped rows. HTTP /v1/memory and CLI
/mem add residue was injected as sibling output. Opt the probe into
exact conversation_id = ?; leave the default OR-NULL fallback for
agent /mem browse.

Co-authored-by: Tyler Reckart <tylerreckart@users.noreply.github.com>
…exact-conversation

# Conflicts:
#	CHANGELOG.md
@tylerreckart
tylerreckart enabled auto-merge (squash) September 21, 2026 13:23
Keep both Unreleased changelog entries.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_eab4fa72-4096-429b-8a48-3aef61402808)

Keep both Unreleased changelog entries.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep both Unreleased changelog entries.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep both Unreleased changelog entries.

Co-authored-by: Cursor <cursoragent@cursor.com>
@tylerreckart
tylerreckart merged commit 7844df5 into main Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants