Repository navigation
Implement opt-in session capture: create ai-chat node at PTY session end - #1168
Conversation
Code Review SummaryThis is a well-structured implementation of opt-in session capture. The core architecture — ring buffer in Findings[Critical/Blocker] Invalid
|
| Criterion | Status |
|---|---|
capture.enabled, capture.sync, capture.content settings |
Done |
| Settings readable/writable via gRPC | Done |
| Settings UI (toggle + content level selector) | Done |
capture.enabled = false → no node created |
Done |
metadata_only → ai-chat node with correct metadata |
Done (schema violation in status value) |
summary and full content levels |
Done |
ai-chat node via NodeService.CreateNode |
Done |
agent_session_id stored as node property |
Done (namespace prefix concern) |
| Capture after PTY exit, non-blocking | Done |
| Failed capture logged, not surfaced to user | Done |
capture.sync = false → excluded from sync |
Missing |
AgentLaunchPanel.svelte capture settings UI |
Done |
| Link to captured ai-chat node in sessions panel | Partial (capturedNodeId always null) |
| Unit tests: metadata_only, full, disabled | Partial (ring buffer tested; finalize_capture not tested) |
bun run test:all passes |
Not verified in PR |
bun run quality:fix passes |
Not verified in PR |
🤖 Generated with Claude Code
…end (closes #1125) - Add SessionCapture ring buffer (max 1MB) to PTY sessions via capture.rs - Extend settings_service.proto with GetCaptureSettings / UpdateCaptureSettings RPCs - Add CaptureConfig + CaptureContentSetting to daemon config (TOML-persisted) - Add capture_service: finalize_capture() creates ai-chat node on session end - Wire capture watcher task in AgentSessionHandler.launch_session - Add get_capture_settings / update_capture_settings Tauri commands - AgentLaunchPanel.svelte: capture settings UI (enable, content level, sync toggle) - SessionsPanel.svelte: show "Capture saved" badge on session end when capture enabled - Frontend CaptureSettings API in tauri-commands.ts with non-Tauri mock fallback - Unit tests for capture ring buffer and frontend settings API Co-Authored-By: Claude <[email protected]>
…t API, tests, cleanup - Fix status field: "completed" → "archived" (matches ai-chat schema closed enum) - Add capture: namespace prefix to all agent-session-specific properties - Refactor: extract build_node_payload() for testability without NodeService - Add 5 Rust unit tests covering content-level gating, status, namespace enforcement - Add snapshot_capture() accessor to PtySession; make SessionCapture Clone - Read CaptureConfig once at session-launch time, pass snapshot to finalize_capture - Add onDestroy cleanup of Tauri event listeners in SessionsPanel to prevent leaks Co-Authored-By: Claude <[email protected]>
7fa5076 to
80f80ef
Compare
…end (#1168) * Implement opt-in session capture: create ai-chat node at PTY session end (closes #1125) - Add SessionCapture ring buffer (max 1MB) to PTY sessions via capture.rs - Extend settings_service.proto with GetCaptureSettings / UpdateCaptureSettings RPCs - Add CaptureConfig + CaptureContentSetting to daemon config (TOML-persisted) - Add capture_service: finalize_capture() creates ai-chat node on session end - Wire capture watcher task in AgentSessionHandler.launch_session - Add get_capture_settings / update_capture_settings Tauri commands - AgentLaunchPanel.svelte: capture settings UI (enable, content level, sync toggle) - SessionsPanel.svelte: show "Capture saved" badge on session end when capture enabled - Frontend CaptureSettings API in tauri-commands.ts with non-Tauri mock fallback - Unit tests for capture ring buffer and frontend settings API Co-Authored-By: Claude <[email protected]> * Address review findings: status=archived, namespace prefixes, snapshot API, tests, cleanup - Fix status field: "completed" → "archived" (matches ai-chat schema closed enum) - Add capture: namespace prefix to all agent-session-specific properties - Refactor: extract build_node_payload() for testability without NodeService - Add 5 Rust unit tests covering content-level gating, status, namespace enforcement - Add snapshot_capture() accessor to PtySession; make SessionCapture Clone - Read CaptureConfig once at session-launch time, pass snapshot to finalize_capture - Add onDestroy cleanup of Tauri event listeners in SessionsPanel to prevent leaks Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Michael Libio <[email protected]> Co-authored-by: Claude <[email protected]>
Closes #1125
Summary
SessionCapturering buffer (max 1 MB) accumulates PTY output per session inpackages/agent/src/pty/capture.rsGetCaptureSettings/UpdateCaptureSettingsadded tosettings_service.proto; backed by[capture]section in~/.nodespace/daemon.tomlcapture_service::finalize_capture()creates anai-chatnode on session end (metadata, summary, or full transcript perCaptureContentLevel)AgentSessionHandler.launch_sessionspawns a watcher task that calls finalize_capture after PTY exitget_capture_settings/update_capture_settingsproxy the gRPC callsAgentLaunchPanel.svelte: expandable "Session capture" section with enable toggle, content level select, and sync toggleSessionsPanel.svelte: shows "Capture saved" badge on ended sessions when capture is enabledTest plan
~/.nodespace/daemon.toml)getCaptureSettingsreturns correct defaults in browser mode (non-Tauri)bun run test -- capture-settings🤖 Generated with Claude Code