Skip to content

feat(memory): render rich markdown and navigable buzz links - #2981

Merged
tellaho merged 6 commits into
mainfrom
tho/memory-rich-markdown
Nov 7, 2026
Merged

tellaho merged 6 commits into
mainfrom
tho/memory-rich-markdown

Conversation

@tellaho

@tellaho tellaho commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Category: improvement

User Impact: Owners can scan their agents’ core memories and saved notes with readable structure, then follow saved Buzz references to inspect the conversations behind a memory.

Problem: Long memories were hard to audit because headings, quoted context, code samples and tables lacked visual hierarchy, while single-line entries ran together. Saved Buzz references appeared as long URLs instead of the recognizable author/channel links used in conversations, making a memory’s supporting discussion harder to inspect.

Solution: Give both Core memories and saved Memories consistent Markdown presentation when expanded, preserving the structure and line breaks the agent wrote. Reuse the app’s existing Buzz link labels, icons, previews and navigation so owners can follow a memory’s source discussion directly.

For someone reviewing what their agent remembers:

  • Scan long memories: headings separate topics; lists, quotes, code and tables make rules, examples and reference material easier to distinguish.
  • Keep individual entries readable: authored line breaks remain visible instead of merging adjacent lines into one paragraph.
  • Inspect the source of a memory: bare Buzz message links can resolve to an Author in #channel label and icon; hover opens the shared preview, and clicking opens the referenced destination in the same community. Authored link labels are preserved, and resolution follows the existing access rules.
  • Reuse the original memory: Copy full body returns the original Markdown, including the original link destinations. The formatted view is derived from the stored text; storage, encryption and how agents receive or retrieve memories are unchanged.

Links inside code remain literal, and remote memory images remain text rather than loading automatically. These changes apply to the memory view in both agent details and profile panels.

Changes

File changes

docs/buzz-help.md
Document memory formatting, link navigation and original-source copying.

src/features/agents/MemoryPanel.tsx
Preserve line breaks and render valid Buzz destinations through the existing MessageLink component. Pass the host’s session and navigation through expanded memory bodies.

src/features/agents/MemoryPanel.module.css
Style headings, lists, quotes, code, tables and links with shared type, color and spacing roles.

src/features/agents/memory-markdown.ts
Recognize bare Buzz URLs in Markdown prose using the existing URL tokenizer, excluding code and authored link contents.

src/features/agents/MemoryPanel.test.tsx
Cover rich markup, image suppression, unsafe destinations, code literals, punctuation, labels, icons, lookup reuse and unavailable-link feedback.

src/features/agents/tabs.tsx
Pass memory-specific link capabilities into the shared memory section.

src/bundled/agents/AgentDetails.tsx
Forward memory link capabilities from the host into agent tabs.

src/bundled/agents/AgentTabs.tsx
Accept memory link capabilities alongside the existing memory reader.

src/bundled/agents/AgentsPage.tsx
Open memory links through scoped app navigation and reject callbacks from retired page visits. Preserve the existing profile-only callback for plugin tabs.

src/bundled/agents/AgentsPage.test.tsx
Exercise memory navigation through the actual page component, including community scope and retired callbacks.

src/bundled/agents/index.tsx
Supply registered link renderers to the Agents page.

src/bundled/profiles/ProfilePanel.tsx
Supply the profile’s session and existing navigation/draft guards to memory links.

src/bundled/profiles/index.tsx
Supply registered link renderers to profile panels.

tests/fixtures/profiles.tsx
Provide the production conversation service required by the profile plugin, keeping the standalone browser fixture aligned with app provisioning.

Reproduction steps

  1. In the desktop app, open an agent’s Memory tab and expand a memory containing Markdown and a Buzz message link.
  2. Verify headings, emphasis, lists, quotes, code, tables and authored line breaks are readable. URLs inside code should remain literal.
  3. Verify a readable message link resolves to the author/channel label and icon. Hover for the shared preview, then click to open its destination in the same community.
  4. Use Copy full body from the memory’s context menu and verify it copies the original Markdown.

Validation

  • The author confirmed manual testing of this change.
  • At 496249d1f006e79a8ae2bcec92c47aef59bf6882, all 42 cases pass across the complete profiles.spec.mjs, profile-verification.spec.mjs and profile-channel-focus.spec.mjs files in Chromium and WebKit. This repairs the missing profile-plugin dependency behind the failed browser shards without changing assertions or timeouts.
  • At 3024148c9621d1f2871dc9eae474c370e103c5e9, all 226 tests pass across the complete MemoryPanel, AgentsPage, AgentTabs, agent-section tabs, ProfilePanel, ProfilePanel fallback and ProfileAgentIdentity test files.
  • Both new Buzz-link memory regressions fail against the previous renderer and pass with this implementation. The line-break regression also failed before its fix.
  • TypeScript, changed-file Biome, commit hooks and diff checks pass. Mandatory pre-push checks, including related unit tests and design-system checks, also pass.
  • No browser journeys added or removed. Component coverage verifies shared preview-trigger wiring; agent-run native hover geometry and theme/width/text-scale checks remain unverified.

Screenshots / demos

Not attached: the headless browser host shows “Agents runs in the desktop app” instead of the memory screen. A native product capture remains pending; the author has confirmed manual testing.

tellaho and others added 3 commits November 7, 2026 01:18
Preserve authored line breaks and style headings, quotes, code, tables, and links with existing design-system roles. Keep remote images inert and retain Markdown parsing limits.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Reuse the existing link renderer and session lookups for bare and labelled Buzz destinations in memory prose. Preserve literal code, original copy content, and host navigation guards.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Register the production conversation service required by the profile plugin so profile controls and panels are available in the standalone browser fixture. Keep all existing assertions and timeouts unchanged.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho
tellaho marked this pull request as ready for review November 7, 2026 19:29
@tellaho
tellaho requested a review from a team as a code owner November 7, 2026 19:29
@tellaho tellaho added the buzz-review-completed Agent review and human UI testing recorded label Nov 7, 2026

@baxen baxen 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.

🤖 Approving. One thing to fix, ideally in a follow-up or before merge:

Memory links get rebuilt from scratch on every re-render. MemoryBody passes react-markdown a components object it creates inline, with a new a renderer each time, so react-markdown sees a new component type on every render and every link is recreated. AgentsPage and ProfilePanel also pass a new memoryLinks object on every render, so any update to those views (for example, an agent's status changing) rebuilds every link in an expanded memory. Users would see:

  • an open hover preview closing
  • keyboard focus dropping off a focused link
  • the "This Buzz link couldn’t be opened here." notice disappearing

MessageMarkdown.tsx already handles this (see the "Keep component types stable" comment): its renderers are defined once at module level and read what they need through a context. The same pattern works here: a module-level a that reads links from a context, which MemoryBody provides.

Minor, not blocking: on the Agents page, opening a memory link leaves the page without the unsaved-changes prompt that the profile panel's path shows. The page's existing open-conversation action already behaves that way, so this isn't a regression.

Keep the Markdown anchor component stable and read current link services through context so parent updates preserve focus and link state. Cover fresh parent props and replacement navigation callbacks.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho

tellaho commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

🤖 @baxen Fixed the memory-link remount in 59985c5. The Markdown anchor renderer now has a stable component type and reads current link services through context, following MessageMarkdown. Fresh parent props preserve the link instance and its state while updated navigation callbacks still take effect.

The regression fails against the previous renderer at 496249d1f and passes with the fix. It checks the same anchor, keyboard focus and unavailable notice survive parent re-renders, and that the replacement callback is used. All 204 tests across five full affected Vitest files pass: MemoryPanel, AgentsPage, ProfilePanel, ProfilePanel.fallback, and ProfileAgentIdentity. Mandatory commit/push gates also pass at the new commit.

Native hover appearance and geometry were not rechecked; hosted CI for the new head is pending. The PR remains ready for review.

@kalvinnchau kalvinnchau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 Two reproducible interaction defects remain: profile memory links reject conversation destinations, and Escape from a memory preview closes the containing agent detail.

Comment thread src/bundled/profiles/ProfilePanel.tsx Resolved
Comment thread src/features/agents/MemoryPanel.tsx Resolved
tellaho and others added 2 commits November 7, 2026 13:29
Resolve memory conversation destinations in the profile community before applying panel-only matching. Preserve dirty and saving guards for both conversation and panel destinations, with regression coverage using the production resolver and entity parser.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Defer the containing workspace Escape handler while an owned preview is open, allowing Base UI to dismiss the nested surface first. Exercise the real memory link and panel workspace together, including the second Escape closing the detail.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho
tellaho merged commit 418dcf3 into main Nov 7, 2026
62 checks passed
@tellaho
tellaho deleted the tho/memory-rich-markdown branch November 7, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

buzz-review-completed Agent review and human UI testing recorded

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants