Repository navigation
fix(memory): Make all memory public - #2684
Merged
Merged
Conversation
A public Conversation never reads private data, so memory recall, search, list, and archive use only the public scope there. Private memories stay available in the person's private Conversations. Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
sentry-junior Bot
added a commit
that referenced
this pull request
Nov 4, 2026
Reverts 02abf67 so the memory scope change ships in its own PR. The policy lists memory recall as an exception until #2684 merges. Co-Authored-By: David Cramer <[email protected]>
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 b2a3db1. Configure here.
Agent invocation, automation, event, and plugin dispatch Sources carry no visibility and can run in a public Conversation. Read private memory only when the Source is explicitly private.
dcramer
reviewed
Nov 4, 2026
dcramer
left a comment
Member
There was a problem hiding this comment.
remove private memories in general, memories are only public going forward. recall can work in private, extraction cannot.
there is too much complexity and the value is not there
Plugin invocation and user prompt contexts now carry a required `conversationVisibility`. Core resolves it once per Turn from the Conversation, so child agents inherit their root's visibility and automations and events get the visibility of the Conversation they run in. The memory plugin reads and writes by Conversation visibility instead of Source visibility. A child agent in a DM recalls the person's private memories again; a child agent in a public channel never does. Co-Authored-By: David Cramer <[email protected]>
Contributor
|
143 screenshot changes — 0 changed · 143 added · 0 removed |
Recall reads only public memory in every Conversation. Writes and passive extraction run only in public Conversations. Stored private rows stay in the table, but no read returns them. Remove the private memory scope from the store, viewer, REST API, user page, and dashboard, and revert the conversationVisibility plumbing.
Contributor
|
Found 4 test failures on Blacksmith runners: Failures
|
The library no longer loads the memory summary, because its only use was the removed visibility tab counts. Load Overview first and return to it after the forget, so the test still proves the forget invalidates the cached summary.
All memory is public, so the upgrade deletes rows with the private scope. Their embeddings and signals go with them through ON DELETE CASCADE. Co-Authored-By: David Cramer <[email protected]>
dcramer
pushed a commit
that referenced
this pull request
Nov 4, 2026
Split out of #2672. Every private Conversation is fully isolated. **Rule between Conversations** (`policies/conversation-access.md`, `canAccessConversation` in `api/conversations/access.ts`). The first match decides: 1. Target in the requester's own tree → allow 2. Target in another provider tenant → deny 3. Public target → allow (read and find) 4. Private target outside the requester's tree → deny, whoever the person is A private requester never writes into a public Conversation. People who look at a private Conversation through the dashboard, API, MCP, or ACP keep participant access. That rule is kept separate from the rule between Conversations. **Behavior changes** - `messageAgent`: a private top-level target is now always denied, also when the person is a participant. Only public agents can message each other. The private-reply prompt branch is gone, and so is the sender Actor lookup. - `searchConversationEvents` / `readConversationEvent`: `main` already followed rows 1–4. They now use the shared check. A missing Conversation now gets the same "not accessible" error as a private one, and the purged-transcript error shows only after access passes. **Not moved to the shared check** - `searchConversationBriefs` / `searchConversationMessages`: these are already public-only and only in public Conversations. With no tenant, the Brief search covers every tenant. The policy lists this under Known gaps. - `slackThreadRead` and the plugin event reader (person-based `canViewPrivateContent`) were not changed. - Memory: #2684 makes memories public only. <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A0c58b0c6675a6c949e0c1d0d6137ddd0 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A0c58b0c6675a6c949e0c1d0d6137ddd0) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A0c58b0c6675a6c949e0c1d0d6137ddd0/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
dcramer
approved these changes
Nov 4, 2026
This was referenced Nov 7, 2026
thomasjiangcy
added a commit
that referenced
this pull request
Nov 9, 2026
…y visibility (#2953) Since #2684, the memory plugin returns `createMemory` and `archiveMemory` only for Sources with public visibility. Event, child-agent, automation, timer, and other Turns have no visibility, so they get only the read tools. Plugin tools are deferred, but the `codemode` tool description lists the script tools, so the native tool list changes between Turns of one Conversation. The provider caches tools before system and messages, so each flip rewrites the whole cached history. Estimate from a 53-conversation prod sample: about 20% of cache-write tokens since 0.278. The fix uses core's existing `disabledReason`. `PluginToolDefinition` now has the same optional field, and `getPluginTools` already passes plugin definitions through unchanged. The memory plugin returns the same four tools in every Turn. For a Source without public visibility, it sets `disabledReason` on the two write tools. Core then lists them as disabled in the Turn context and rejects their calls before hooks, action review, and execution, for direct, `executeTool`, and `codemode` calls. Neither the `codemode` description nor the `searchTools` catalog reads `disabledReason`, so they render the same for enabled and disabled tools. Write behavior for public Sources does not change. I did not use a check inside `execute`. It would skip the Turn-context listing and run hooks and review first. Tests: - The memory host-wiring scenario builds tools for a public Slack Turn and an event Turn in the same Conversation. It checks that the model-facing tool list, including the `codemode` description, is byte-identical. It also checks that an event-Turn `createMemory` call through `executeTool` fails with the disabled message and writes nothing. - The adapter disabled-tool test now covers a `codemode` script call too. <!-- junior-request-attribution:start --> via @thomasjiangcy. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A1689aa90fa8a251d2fa49fb8f6f022c7 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A1689aa90fa8a251d2fa49fb8f6f022c7) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A1689aa90fa8a251d2fa49fb8f6f022c7/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Thomas Jiang <[email protected]>
This was referenced Nov 9, 2026
dcramer
pushed a commit
that referenced
this pull request
Nov 13, 2026
Follow-up to #3129. Plugin packages now test against real Postgres with config and one function from `@sentry/junior-testing`, not a package-local harness. ## API ```ts // vitest.config.ts test: { globalSetup: ["@sentry/junior-testing/postgres/global-setup"], setupFiles: ["@sentry/junior-testing/postgres/setup"], provide: { postgresSkipMigrations: ["0008_native_code_backfill.sql"] }, // optional } // tests/fixture.ts import { createPostgresTestFixture } from "@sentry/junior-testing/postgres/fixture"; createPostgresTestFixture<TDatabase>( connect: (pool: pg.Pool) => TDatabase, ): Promise<{ db(): TDatabase; execute(sql, params?): Promise<void>; close(): Promise<void> }> ``` - `global-setup` applies every `.sql` file in `<package>/migrations` (minus `postgresSkipMigrations`) to one template database. It uses `DATABASE_URL`, or the `compose.yaml` Postgres on port 54322. - `setup` truncates the worker database before each test. - The package passes `drizzle(pool, { schema })` to the fixture, so the fixture uses the package's own `drizzle-orm`. When `junior-testing` built the client, tests loaded a second `drizzle-orm` copy and the GitHub suite got about 1s slower. - `vitest` is a peer dependency of `@sentry/junior-testing`, so its hooks and `inject` use the package's Vitest instance. ## Moved - `junior-github`: deletes its `tests/global-setup.ts` and the reset wiring in `tests/setup.ts`. - `junior-memory`: deletes the PGlite dump/copy fixture. The `vector` and `btree_gin` extensions come from the `pgvector/pgvector:pg17` service. Two test edits: - The timezone test now runs `SET LOCAL TIME ZONE` and the report in one transaction. A session `SET` on a pool reaches only one connection. - Removes `installViewerCoreTables`. Nothing has read those core tables since #2684. - `junior-google`: deletes its PGlite fixture. `test / plugins` already has the Postgres service from #3129. No CI change. ## Not moved - Core keeps its own harness. It migrates with the Drizzle migrator, sets `DATABASE_URL` for the runtime, and re-inserts the system Identity after truncation. It already uses the shared `setupPostgresTemplate` and `resetPostgresTestDatabase`. Evals now use the shared `assertLocalPostgresUrl` too. - `@sentry/junior-testing/pglite` stays because core's `tests/fixtures/sql.ts` still falls back to PGlite when `DATABASE_URL` is unset. Its unused extension exports and `loadDataDir` option are removed. ## Local results (4 vCPU sandbox, pgvector/pgvector:pg17) | Suite | main | this PR | | --- | --- | --- | | `@sentry/junior-github` (327 tests) | 9.3s | 9.4s (9.2–10.1s over runs) | | `@sentry/junior-memory` (94 tests) | 32.3s | 4.5s | | `@sentry/junior-google` (32 tests) | 8.1s | 2.3s | - Core `tests/component`: 87 files, 759 tests pass (95s). - `@sentry/junior-evals test`: 11 files pass. - `pnpm typecheck` and `pnpm lint` pass. No `junior_test_*` databases are left after a run. <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3Aa51fbcc6f0d259a2327c7ada20a260ad --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3Aa51fbcc6f0d259a2327c7ada20a260ad) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Aa51fbcc6f0d259a2327c7ada20a260ad/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
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.

![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
All memory is now public. Recall works in every Conversation, including DMs and private channels. Writes and passive extraction run only in public Conversations.
countMemories, and the/countsroute are gone.conversationVisibilityplumbing in core and plugin-api. Source visibility is enough.Migration
0014_delete_private_memories.sqldeletes everyjunior_memory_memoriesrow with theprivatescope (and the pre-renamepersonallabel). Theirjunior_memory_embeddingsandjunior_memory_signalsrows go with them through the existingON DELETE CASCADEforeign keys.The scope column, its check constraint, and
MEMORY_SCOPESstay as they are. Reads still filter by scope, so a private row that an older deploy writes during the rollout stays hidden, and a tighter check constraint would make those older writes fail. Historical event schemas and captured snapshots still accept the legacypersonal/privatelabels, because stored events use them.via @dcramer.
--
View Session [Sentry]