feat(memory): carry bot-owned notes across chats - #293
Merged
Merged
Conversation
|
This comment has been minimized.
This comment has been minimized.
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.
Bots need small, editable notes that carry useful context into later chats. This replaces saved facts with bot-owned
USER.mdandMEMORY.mdfiles and separateGROUP.mdnotes for each group. Chat observations remain separate.Memory is supplied on every turn, with enforced file limits and a review after ten successful prompts in each private or group scope. Recent context now keeps 30 complete turns within a roughly 64,000-token budget, retaining messages that observations have not covered. Web and mobile memory editors support direct changes, and archive import/export preserves notes and observations. Approved legacy facts migrate once; unsupported or overflowing facts remain in an archive.
The final fixes bound hand-edited prompt context, reject stale saves and changed bot ownership, reject cross-chat archive restores, and preserve pending observations. Failed imports roll back file and observation changes; queued observation writes cannot be erased by a stale restore. Failed lock initialization releases its handle and lock before retry.
Verified with 442 focused tests, server/web/mobile/contracts/client-runtime typechecks, targeted lint, browser save/reload/clear and archive round-trip, and real GPT-5.6 Sol conversations. The live cadence test completed ten prompts and verified one successful review call on turn eleven. Automated-review fixes passed 208 focused tests, including real LibSQL restore failure and stale-preview cases, plus browser stale-save rejection and archive restoration. Native mobile device execution and live calls through other providers were not tested. Desktop uses the shared web renderer; no Electron shell behavior changed.
Created with GPT-6 Astra in Codex.