Agent TUI: browse, inspect, and delete conversations and sessions #138

Closed
opened 2026-08-22 09:40:21 +00:00 by hugo · 1 comment
Owner

Goal

Expand the current metadata-only Sessions screen into an operator conversation/session browser. It must list conversations with avatar, channel, timestamps, size/status metadata; open the selected transcript; and delete the selected conversation safely.

Current state and Mentra discovery

MetaCrate already owns the logical conversation index:

  • ConversationStore::list_metadata() returns session ID, avatar UUID, channel, created/last-active time, turns, and bytes.
  • ConversationStore::context() holds the bounded, trust-labelled message projection.
  • delete() and expire() already remove a logical session; the control plane currently exposes only metadata listing and an expire shortcut for the first row.

Mentra 0.18.3 owns the model transcript:

  • Runtime::list_persisted_agents() returns persisted agent ID/name/status/history length without reviving the agent.
  • resume_agent() exposes the active AgentTranscript, including active items, archived branches, message/tool entries, and compaction history.
  • Mentra does not expose an agent/transcript delete or clear API, and its persisted record fields/timestamps are intentionally private. Direct SQLite deletion would couple MetaCrate to Mentra internals and is not acceptable.

Authorized avatar conversations reuse one Mentra agent so long-term memory survives session rollover. Therefore deleting a conversation should clear the selected logical transcript/session while preserving durable memories by default. This needs a Mentra host API that can clear/reset a transcript in place without changing the memory namespace. Session-scoped public/unprivileged Mentra agents may instead be deleted once Mentra exposes a supported delete API.

Design

  • Keep ConversationStore as the source of avatar/channel/time metadata and add a bounded operator-only entry projection that retains timestamp, role, record kind, trust label, and sanitized text.
  • Persist an explicit mapping between logical conversation/session IDs and Mentra agent IDs/profile generation; never parse the versioned agent name to establish authority.
  • Add control requests for filtered/paged conversation listing, selected conversation detail, and selected deletion. Filters should include avatar UUID/name when known, channel, active/expired state, and time range.
  • Show the MetaCrate conversation alongside relevant Mentra transcript metadata (tool exchanges, compaction, active/archived path) without exposing system prompts, credentials, raw approvals, or unbounded tool payloads.
  • On delete: confirm the exact selected session, cancel/fence an active inference for it, clear the MetaCrate session and its persisted snapshots, clear/delete the corresponding Mentra transcript through a supported Mentra API, preserve durable long-term memories unless separately removed in the memory browser, and audit IDs/outcome without logging message content.
  • Observer tokens may list redacted counts/metadata but cannot read transcript text or delete.

Acceptance criteria

  • The TUI can page/filter sessions, select any row rather than the first, view all bounded transcript entries with avatar/channel/timestamps/roles, and return to the list without losing selection.
  • Active, compacted, expired, and restarted sessions have understandable metadata and deterministic ordering.
  • Deleting one selected conversation removes its visible transcript and persisted session across restart, does not affect another avatar/channel, and does not silently delete durable Mentra memories.
  • An active request is cancelled/fenced before deletion; stale completion cannot recreate the deleted transcript.
  • Operator-only content access, confirmation, audit, pagination/content bounds, and cross-avatar isolation have control-plane and TUI tests.
  • The implementation uses supported Mentra runtime/transcript lifecycle APIs; if 0.18.3 still lacks clear/delete, add that capability upstream or upgrade Mentra rather than editing its SQLite files.

No implementation is part of this issue creation pass.

## Goal Expand the current metadata-only Sessions screen into an operator conversation/session browser. It must list conversations with avatar, channel, timestamps, size/status metadata; open the selected transcript; and delete the selected conversation safely. ## Current state and Mentra discovery MetaCrate already owns the logical conversation index: - `ConversationStore::list_metadata()` returns session ID, avatar UUID, channel, created/last-active time, turns, and bytes. - `ConversationStore::context()` holds the bounded, trust-labelled message projection. - `delete()` and `expire()` already remove a logical session; the control plane currently exposes only metadata listing and an expire shortcut for the first row. Mentra 0.18.3 owns the model transcript: - `Runtime::list_persisted_agents()` returns persisted agent ID/name/status/history length without reviving the agent. - `resume_agent()` exposes the active `AgentTranscript`, including active items, archived branches, message/tool entries, and compaction history. - Mentra does not expose an agent/transcript delete or clear API, and its persisted record fields/timestamps are intentionally private. Direct SQLite deletion would couple MetaCrate to Mentra internals and is not acceptable. Authorized avatar conversations reuse one Mentra agent so long-term memory survives session rollover. Therefore deleting a conversation should clear the selected logical transcript/session while preserving durable memories by default. This needs a Mentra host API that can clear/reset a transcript in place without changing the memory namespace. Session-scoped public/unprivileged Mentra agents may instead be deleted once Mentra exposes a supported delete API. ## Design - Keep `ConversationStore` as the source of avatar/channel/time metadata and add a bounded operator-only entry projection that retains timestamp, role, record kind, trust label, and sanitized text. - Persist an explicit mapping between logical conversation/session IDs and Mentra agent IDs/profile generation; never parse the versioned agent name to establish authority. - Add control requests for filtered/paged conversation listing, selected conversation detail, and selected deletion. Filters should include avatar UUID/name when known, channel, active/expired state, and time range. - Show the MetaCrate conversation alongside relevant Mentra transcript metadata (tool exchanges, compaction, active/archived path) without exposing system prompts, credentials, raw approvals, or unbounded tool payloads. - On delete: confirm the exact selected session, cancel/fence an active inference for it, clear the MetaCrate session and its persisted snapshots, clear/delete the corresponding Mentra transcript through a supported Mentra API, preserve durable long-term memories unless separately removed in the memory browser, and audit IDs/outcome without logging message content. - Observer tokens may list redacted counts/metadata but cannot read transcript text or delete. ## Acceptance criteria - The TUI can page/filter sessions, select any row rather than the first, view all bounded transcript entries with avatar/channel/timestamps/roles, and return to the list without losing selection. - Active, compacted, expired, and restarted sessions have understandable metadata and deterministic ordering. - Deleting one selected conversation removes its visible transcript and persisted session across restart, does not affect another avatar/channel, and does not silently delete durable Mentra memories. - An active request is cancelled/fenced before deletion; stale completion cannot recreate the deleted transcript. - Operator-only content access, confirmation, audit, pagination/content bounds, and cross-avatar isolation have control-plane and TUI tests. - The implementation uses supported Mentra runtime/transcript lifecycle APIs; if 0.18.3 still lacks clear/delete, add that capability upstream or upgrade Mentra rather than editing its SQLite files. No implementation is part of this issue creation pass.
hugo added this to the 14 - metacrate grid agent milestone 2026-08-22 09:40:21 +00:00
hugo added the enhancement label 2026-08-22 10:53:56 +00:00
Author
Owner

Implemented and pushed in 096911a. The Sessions TUI now has deterministic active/expired/compacted metadata, avatar/channel/status/time filters, list and transcript paging, selection-preserving detail/back navigation, and exact high-risk delete. Operator detail combines bounded sanitized MetaCrate entries with content-free Mentra active/archive/tool/compaction metadata; observers receive pseudonymous metadata and cannot read or delete. Added persisted logical-session→Mentra-agent/profile-generation mappings and a supported Mentra transcript-clear API. Delete cancels/fences the selected active run, persists exact MetaCrate removal, clears only working transcript state, preserves durable memories, and stale completions cannot recreate the session. Focused restart/isolation/bounds/role/audit/TUI tests pass; strict live-grid Clippy, MetaCrate rustdoc, Mentra strict Clippy, dependency policy 7/7, and acceptance gate 2/2 are green. Mentra standalone rustdoc still reports its pre-existing unrelated broken links.

Implemented and pushed in 096911a. The Sessions TUI now has deterministic active/expired/compacted metadata, avatar/channel/status/time filters, list and transcript paging, selection-preserving detail/back navigation, and exact high-risk delete. Operator detail combines bounded sanitized MetaCrate entries with content-free Mentra active/archive/tool/compaction metadata; observers receive pseudonymous metadata and cannot read or delete. Added persisted logical-session→Mentra-agent/profile-generation mappings and a supported Mentra transcript-clear API. Delete cancels/fences the selected active run, persists exact MetaCrate removal, clears only working transcript state, preserves durable memories, and stale completions cannot recreate the session. Focused restart/isolation/bounds/role/audit/TUI tests pass; strict live-grid Clippy, MetaCrate rustdoc, Mentra strict Clippy, dependency policy 7/7, and acceptance gate 2/2 are green. Mentra standalone rustdoc still reports its pre-existing unrelated broken links.
hugo closed this issue 2026-08-23 17:50:17 +00:00
Sign in to join this conversation.