Repository navigation
Conversation
Signed-off-by: WhiteZeek <53357346+WhiteZeek@users.noreply.github.com>
WhiteZeek
added this pull request to stack #22083
October 20, 2026 14:15
6 of 7 tasks
This branch has not been 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.
What this PR does
Before this PR: Ordinary Assistants cannot use the shared user-memory tier introduced for Agents in #22068.
After this PR: Assistants can opt in through
settings.userMemoryEnabled(default false, stored in the existing settings JSON). Persistent desktop chat injects fresh shared facts and exposes a built-inuser_memorytool for read, revision-checked update, append, and journal search. Updates and appends use the existing approval flow; storage reuses #22068's mutex, revision checks, and atomic writes.Only the persistent, non-headless chat dispatcher supplies the main-only access context. Loading and tool execution validate the live Assistant setting and topic ownership. Temporary/auxiliary requests, caller-owned context, and Agent/channel dispatch receive no access. Non-tool models and tool-disabled requests can receive facts but cannot write. Agent-local files are never exposed.
Related to #15669; stacked on #22068. This is the ordinary-Assistant extension, not completion of the original issue.
Why we need it and why it was done in this way
The following tradeoffs were made: Assistant memory is opt-in to preserve existing chat behavior. The UI switch belongs to the next layer. Clearing facts changes future snapshots, not prior conversations or an in-flight request.
The following alternatives were considered: Reuse the shared file store instead of adding database tables or Assistant-local USER.md files. Use a built-in tool instead of asking users to configure filesystem MCP. A main-only dispatch grant prevents auxiliary calls from gaining access merely by supplying an Assistant ID.
Links to places where the discussion took place: #22068 and #15669.
Agent Note / Spec
Agent Note: N/A — the author explicitly requested no Agent Note files; rationale is recorded here.
Spec PR: N/A — the author approved implementation of this first layer in the task conversation.
Acceptance criteria: Opt-in defaults/partial updates; Assistant-to-Agent shared facts; fresh, single-section recall; no Agent-local file exposure; no temporary/headless/caller-owned access; live opt-out/ownership checks; stale-write rejection and approval-gated mutations.
Verification
--project main --maxWorkers=2), 279 passed acrossidentity.test.ts,buildAgentParams.test.ts, dispatch tests, builtin registration tests, andAssistantService.test.ts. Real temporary SQLite and memory files cover interop, concurrency, ownership, and opt-out. Provider setup is stubbed for request-assembly checks; no live model call is claimed.pnpm exec vitest run --project shared src/shared/data/api/schemas/__tests__/assistants.test.ts: 5 passed.pnpm typecheck:node,pnpm typecheck:web, scoped Oxfmt/ESLint/Oxlint,pnpm docs:check, andgit diff --checkpassed.pnpm change:scope --base codex/user-shared-memoryandpnpm docs:affected --base codex/user-shared-memoryinspected. Docs cover the access boundary, tool, and pending UI.Breaking changes
None. Missing or false
settings.userMemoryEnabledkeeps existing Assistant behavior; no database migration, new table, or dependency is required. Agent memory behavior is unchanged.Special notes for your reviewer
Review against
codex/user-shared-memory, notmain. This PR intentionally contains only the runtime/configuration/tool layer; the settings form control is deferred. No new Agent Note artifacts. Tests ran on Windows with Electron Node mode to match SQLite ABI. Real-provider behavior, native macOS/Linux execution, and interactive approval UI were not exercised in this layer.Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
main(stacked layer: targetscodex/user-shared-memoryuntil feat(agents): add desktop shared user memory #22068 merges)/gh-pr-review,gh pr diff, or GitHub UI) before requesting review from othersRelease note