Repository navigation
perf(memory): tell agents to prefer shared notes over tool memory - #384
Conversation
The generated guidance block defined "what is worth saving" the same way agents' built-in memory does, but never said how the two relate, so agents with their own memory kept saving there and left the shared folder alone. The active rule now says to save here instead of tool-specific memory, gives a note format and an INDEX.md line shape, and both modes read INDEX.md at the start of each task instead of "when relevant". The passive rule asks agents to point out facts worth keeping so the user can ask for them to be saved. Dashboard mode descriptions, the CLI help, and the website pages are updated to match. Test fixtures that anchored on "Read only" follow the new wording.
- The LEARNED.md starter said to update only on request, which contradicted the active memory guidance; it now defers to the guidance. - website/AGENTS.md hardcoded a command-page count that had drifted and omitted the Desktop App navbar item. - wiki/testing.md gave `bash -c` and `bash -lc` as the rule in different places; it now says which container needs which, and why. - Migration-relative wording in wiki/architecture.md and an unexplained "Always use" in the targets reference are stated as current rules with their reason.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ea51b1890
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| passiveRule = "Update these notes only when the user requests it." | ||
| activeRule = "Save a note only when you learn something that will still matter in future sessions: a stated user preference, a decision with its reason, or a pitfall you confirmed. Skip one-off task details, guesses, and anything the repository already records. When you are unsure whether something is worth keeping, propose the note to the user and save it only if they agree. Before writing, search the existing notes: update or correct the matching note instead of adding a duplicate, and remove a note proven wrong. Keep each note to one fact, link it from `INDEX.md`, never record secrets, and tell the user in one line what you saved." | ||
| passiveRule = "Update these notes only when the user requests it. When you notice something worth keeping, such as a stated preference, a decision with its reason, or a pitfall you confirmed, say so in one line so the user can ask you to save it." | ||
| activeRule = "When a fact is worth keeping across sessions, save it here instead of in this tool's own memory; use tool-specific memory only for things that matter to this tool alone. Save a note when you learn something that will still matter later: a stated user preference, a decision with its reason, or a pitfall you confirmed. Skip one-off task details, guesses, and anything the repository already records. When you are unsure whether something is worth keeping, propose the note to the user and save it only if they agree.\n\nOne fact per file, kebab-case `.md`, first line `# Title`, then the fact and why. Add a `- [Title](file.md)` line with a short hook under `## Notes` in `INDEX.md`. Before writing, search the existing notes and update or remove them instead of adding a duplicate. Never record secrets. Tell the user in one line what you saved." |
There was a problem hiding this comment.
Reconcile the one-fact rule with LEARNED.md
When an active agent learns another durable lesson, this new rule requires a separate file, but initialization still creates LEARNED.md as a multi-entry lesson template (internal/memory/store.go:278-279) and the public workflow explicitly tells users to ask agents to update that file (website/docs/how-to/daily-tasks/sharing-memory.md:167-171). The generated instructions therefore force the agent either to violate the one-fact-per-file rule or to ignore the advertised starter workflow, producing inconsistent memory layouts; either exempt LEARNED.md or align the template and documentation with per-fact files.
AGENTS.md reference: AGENTS.md:L15-L15
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 464d2fa. The active rule now routes by kind instead of saying one fact per file: a durable fact or decision gets its own kebab-case file linked from INDEX.md, and a lesson from a failure goes under a new heading in LEARNED.md with date, context, conclusion, and evidence. That matches the starter template fields and the workflow the sharing-memory page describes, so neither needed to change. Covered by TestInstructionsModes and the memory integration tests, which render the generated block.
The active rule asked for one fact per file, while init still creates LEARNED.md as a multi-lesson log and the docs tell users to have agents update it. The rule now says which goes where: a fact or decision gets its own file linked from INDEX.md, a lesson from a failure gets a new heading in LEARNED.md. Refs Codex review on #384.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 464d2fab73
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "An empty --version creates a new note. To update, use the version from show --json.", | ||
| "Changes are backed up; a stale version is rejected. Native automatic memory is separate.", | ||
| "--update-mode passive (default) lets agents update notes only when asked; active lets them save lasting facts and propose ones they are unsure of.", | ||
| "Both modes read INDEX.md at the start of each task. --update-mode passive (default) only points out facts worth keeping; active saves them here instead of the tool's own memory and proposes ones it is unsure of.", |
There was a problem hiding this comment.
Preserve passive mode's on-request saving behavior
The new help text says passive mode “only points out facts worth keeping,” which implies that it never saves notes. The generated passive rule still explicitly allows updates when the user requests them, and the dashboard and website descriptions retain that behavior. Users choosing a mode from extras memory --help can therefore select it based on an incorrect contract; describe passive mode as pointing facts out and saving them only when asked.
AGENTS.md reference: AGENTS.md:L15-L15
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 3a83de1. The help now reads: passive points out facts worth keeping and saves them only when asked; active saves them here instead of the tool's own memory. Matches the generated passive rule and the dashboard and website descriptions.
The --update-mode help described passive as only pointing facts out, which dropped the on-request saving that the generated rule, dashboard, and docs all keep. Refs Codex review on #384.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a83de16d5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| starters := []struct{ path, content string }{ | ||
| {"INDEX.md", "# Shared memory\n\nKeep durable notes in this folder. Link relevant notes here with standard Markdown links.\n\n## Notes\n\n- [Lessons learned](LEARNED.md)\n"}, | ||
| {"LEARNED.md", "# Lessons learned\n\nRecord durable lessons and verified solutions. Update only when the user requests it. Verify changeable claims before reusing them.\n\n## Lesson title\n\n- Date:\n- Context:\n- Conclusion:\n- Evidence:\n"}, | ||
| {"LEARNED.md", "# Lessons learned\n\nRecord durable lessons and verified solutions here. Your memory guidance says when to update these notes. Verify changeable claims before reusing them.\n\n## Lesson title\n\n- Date:\n- Context:\n- Conclusion:\n- Evidence:\n"}, |
There was a problem hiding this comment.
Migrate the previous LEARNED starter
For users upgrading with the starter LEARNED.md created by the previous release, changing only this literal has no effect: Init skips every readable existing starter at lines 282–283, so their file still says to update only when requested while the new active guidance explicitly routes lessons from failures there for autonomous saving. Reconnecting updates the guidance block but leaves these users with contradictory policies; migrate only the exact old starter safely, or keep the active rule compatible with it.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Leaving this as is. Notes are user-owned files and Skillshare does not rewrite their content on upgrade; a LEARNED.md created under 0.24.x keeps whatever the user has in it, template sentence included. The rule that governs saving is the guidance block in the agent's instruction file, which reconnecting does update, and the new starter sentence only points at that block. Adding an exact-match migration of a one-line template for a feature released days ago would cost more than the mismatch it removes, so I'd rather not add that code path.
Rewrites the generated notes as user-facing entries with examples, drops the duplicate Performance line that the #384 merge commit produced, and syncs the website changelog.
Type
proposals/only — see CONTRIBUTING.md)Linked Issue
None.
Summary
The shared-memory guidance block told agents what is worth saving, but never said how the shared folder relates to the agent's own built-in memory. Agents with their own memory (Claude Code, Codex) kept saving there and left the shared notes alone, even in
activemode.INDEX.mdat the start of each task instead of "when prior context is relevant".activesays to save here instead of in the tool's own memory, and gives a note format and anINDEX.mdline shape.passivestill updates only on request, but asks the agent to point out facts worth keeping so the user can ask for them.LEARNED.mdstarter no longer says "update only when the user requests it", which contradicted the active rule.Second commit fixes stale facts a prompt audit turned up in
website/AGENTS.md,wiki/testing.md,wiki/architecture.md, and the targets reference.Existing guidance blocks will show as Outdated in the dashboard after upgrading; reconnecting rewrites them.
Checks run
go test ./internal/memory/ ./internal/server/ ./cmd/...make build && go test ./tests/integration/ -run Memory -count=1pnpm vitest run src/components/memory(22 passed)python3 scripts/ai-context.py checkNot run: full
make check, website build.Checklist
make check) — targeted Go, UI, and integration tests ran; fullmake checkwas not run