Skip to content

feat(bestie): Remembers you, a memory switch on the Bestie tab - #2035

Open
rileycrane wants to merge 3 commits into
rileycrane/bestie-l1-tabfrom
rileycrane/bestie-l2-memory
Open

rileycrane wants to merge 3 commits into
rileycrane/bestie-l1-tabfrom
rileycrane/bestie-l2-memory

Conversation

@rileycrane

@rileycrane rileycrane commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

The Bestie tab gets Remembers you: a switch that adds memory rules to the agent's instructions, and removes them when turned off.

Why it works this way: the memory rules are a marked, versioned section of the agent's own instructions, so the owner can read and edit them, and later features can add sections the same way.

What changes

  • On adds a section marked <!-- buzz:bestie/memory v1 --> … <!-- /buzz:bestie/memory --> to the instructions. Off removes it. No memory is deleted: core memory is still in every prompt, and the Memory tab still clears memory.
  • The switch follows the markers. It stays on through the owner's edits inside the section. Off keeps any text the owner put before or after the markers.
  • Edited markers. If a marker is edited, removed or copied, the row says the section was edited instead of showing a switch, so it never adds a second section. Restore puts the original back when the markers still show where the section is.
  • Feature list. features.ts holds the feature list. Memory is its first entry; check-ins (feat(bestie): hourly check-ins from your Bestie #2037) add one more.

Design decisions

  • On and Off save the agent's instructions through agents.save; the next turn uses them. Rejected: a hidden section the host adds to every prompt.
  • An edited section blocks On rather than guessing. Rejected: rewriting the owner's edits.

Try it (just dev, with a local agent that is your Bestie)

  1. Open its Bestie tab and turn Remembers you on. Open Instructions: the marked memory section is at the end.
  2. Type a line inside the section and save. The switch stays on.
  3. Turn it off. The section is gone, and the text you wrote outside it stays.
  4. Delete one marker in Instructions. The row says the section was edited, with Restore. Click Restore to put the section back.

Stack: each PR is based on the one before it: #2034 Bestie tab → #2035 Remembers you (this PR) → #2036 private channels → #2037 check-ins → #2039 Former Bestie → #2041 Remove as Bestie → #2047 Choose your bestie. #2040 (recent notes in Claude Code prompts) is separate and based on main.

Overlap: #1716 also changes features/agents/service.ts and tabs.tsx. Whichever lands second will rebase onto the other.

🤖 Generated with Claude Code

buzz-review-completed

rileycrane and others added 3 commits October 30, 2026 14:33
Turning it on appends Bestie's memory rules to the agent's instructions,
marked <!-- buzz:bestie/memory v1 --> … <!-- /buzz:bestie/memory -->.
Turning it off removes that section. The switch shows whether the section
is there. It saves through agents.save with the head the tab shows, as the
Instructions editor does, so synced instructions publish the 45010
artifact and the idle agent restarts with the new prompt.

The section text is the Memory rules from prompt.ts, adapted to the local
memory tools. The plugin keeps a short feature list so check-ins can
be added as its next entry.

Co-authored-by: eggboy <3986e5374b8c11a274f4a53fa9a68e1e18b53e712f8aa5218add2485bf5a2b09@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Riley Crane <rileycrane@squareup.com>
Without a confirmed copy, the agent's instructions aren't shown, so a
save from the switch would replace them. The tab now shows the problem
instead of a switch.

Markers count only when each is on a line of its own, so marker text
quoted in the owner's prose is left alone. Off removes every copy of
the section, keeps the indentation of the next line, and handles CRLF.

The memory rules now agree with the base prompt: no fixed core size, no
claim that core is current, links from core to the other slugs, and
turning the switch on counts as the owner's approval to save, while
changing something the owner said before still needs their OK.

Co-authored-by: eggboy <3986e5374b8c11a274f4a53fa9a68e1e18b53e712f8aa5218add2485bf5a2b09@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Riley Crane <rileycrane@squareup.com>
A section was found only with each marker alone on its line. On ends the
instructions with the closing marker, so typing below the section landed
on that line: the switch read off, Off found nothing to remove, and On
added a second section. Markers are now found anywhere on their line, and
text next to them stays the owner's when Off removes the section; the
owner's line ending after their text is kept too. A marker edited, removed
or copied by hand shows the section as edited instead of a switch, and On
refuses it; Restore puts back the original in place of its two markers
and what lies between them, when they still show where it was.

Co-authored-by: eggboy <3986e5374b8c11a274f4a53fa9a68e1e18b53e712f8aa5218add2485bf5a2b09@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Riley Crane <rileycrane@squareup.com>

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Star Lord’s automated source review via Wes’s account. Reviewed head a5d42ff against base 89d58c1 (also the merge base).

One actionable keyboard-focus finding is inline. The memory section and UI reuse the existing confirmed agent-config writer; the source checks preserve unrelated config, bind writes to the displayed revision, and refuse unreadable config. Public PR description and all three commit messages were inspected; the description contains no attached images, and no concrete disclosure was found.

Source-only review with Rocket (systems/lifecycle), Mantis (correctness/security/concurrency), Groot (product/accessibility), and Star Lord integration. No PR code, tests, builds, app, or live persistence workflow was executed. The latest CI run in the one-time snapshot, 41144263263, passed its required check; Windows native validation and the browser flake-selection matrix job were skipped. An earlier run in the snapshot was cancelled with a failed aggregate. Native keyboard/screen-reader behavior, rendered themes/sizing, and incremental test cost remain unverified. This COMMENT is not approval or merge authorization.

<Button
variant="outline"
disabled={saving}
onClick={() => void run(() => saveInstructions(restored))}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [P2] Preserve keyboard focus when Restore replaces its control

When an owner repairs an edited memory section with the keyboard, the confirmed instructions change this branch from "edited" to "on". That unmounts Restore and mounts the switch at lines 273–279, but neither this component nor its agent-tab hosts transfer focus to that replacement. The existing ProfilePanel focus effect runs only on mount/tab-host changes, and AgentDetails' setup focus fallback runs only on mount, so neither handles this save. The user loses the focused action at the end of recovery. This conflicts with the focus-preservation rules in src/shared/design-system/DESIGN.md (States, feedback, and motion / Loading without flicker).

Keep focus through the pending operation and hand it to the resulting switch once the confirmed config is rendered, only if the user has not moved elsewhere. The shared Button's loading state can preserve pending focus/busy semantics. Extend the Restore test through the confirmed-config rerender and check success and failure/retry focus. This is source inference; the exact browser focus destination and assistive-technology announcement were not exercised.

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.

2 participants