Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.
TypeScript cross-platformelectronffmpegopen-sourceproduct-demorustscreen-capturescreen-recorderscreen-recordingscreen-studioscreencastspeech-to-texttypescriptvideo-editingvideo-editorwaylandwgpuwhisper
docs(ai): describe persisted Agent chat sessions
EtienneLescotc1d6a6ca1537
diff --git a/technical-documentation/architecture/ai-agent.md b/technical-documentation/architecture/ai-agent.mdindex 5136f0ae2..ffb0fddb2 100644--- a/technical-documentation/architecture/ai-agent.md+++ b/technical-documentation/architecture/ai-agent.md@@ -83,11 +83,13 @@ Before a user message starts an agent turn, `chat-service.ts` clones the currentSessions are scoped first by project ID and then by session ID. Each session stores a generated ID, project ID, title, creation timestamp, messages, and per-user-message checkpoint references. The renderer can create, select, rename, delete, compact, and rewind sessions through the native bridge.-Chat sessions and checkpoints live only in nested process-memory `Map` objects in `chat-service.ts`. They are not written to project files or user data, so restarting Electron loses the conversation and its restore checkpoints. Provider configuration and encrypted credentials are separate and do persist.+Sessions persist per project in a versioned sidecar, `<projectId>.chat.json`, beside the `.openscreen` document in `userData/projects` (`chat-persistence.ts`). It holds each session's title, timestamps, messages and compaction summary; never provider configuration or credentials. `chat-service.ts` caches a project's sessions on first use and queues every change to disk asynchronously, one queue per project, through a temp file, `fsync` and rename; a project deletion is queued behind its pending writes, and quitting the app waits for the queue. A malformed, foreign or older file is skipped, never an error, so it cannot stop the project from opening. Provider configuration and encrypted credentials are stored separately.++Document checkpoints stay in process memory. After a restart the conversation comes back, but its rewind controls do not: a message exposes a checkpoint id only while its snapshot is still held.## Known gaps-- Chat sessions and message checkpoints have no durable persistence.+- Message checkpoints have no durable persistence, so rewind only reaches turns sent since the app started.- `allowAgentEdits` has no per-turn approval channel. When it is off the agent reads freely, is told by its system prompt to state the edit and ask, and has every write refused by `executeAgentTool` with a `consent_required` payload; the returned document is withheld as well. But there is no way for the user to answer "yes, go ahead" for one turn — they have to re-enable the setting in Settings → AI, which is what the refusal tells the model to say.- Cursor telemetry is read through an injected `CursorTelemetryReader` (`electron/ipc/handlers.ts` builds the only production one, behind `resolveApprovedVideoPath`). A runtime with no reader wired answers `reason: "unavailable"` on every call and reports `hasCursorTelemetry: null` — honest, and useless. There is no cache: a turn probes each asset's sidecar once, then reads it in full for every call in `TOOLS_READING_CURSOR` — `getCursorTrack` and the three zoom writes, which need it to report `cursorAnchor`. N separate `addZoom` calls therefore re-read the same file N times; `addZooms` is what keeps a whole zoom pass to one read.- `readCursorSidecar`'s normalizer flattens `double-click` / `right-click` / `middle-click` to `move` before the track is built, so those clicks reach the model as plain moves rather than as the events they were. The narrowing is upstream, in `CursorRecordingSample`.diff --git a/technical-documentation/testing/manual-e2e-checklist.md b/technical-documentation/testing/manual-e2e-checklist.mdindex 252bfff96..256a111de 100644--- a/technical-documentation/testing/manual-e2e-checklist.md+++ b/technical-documentation/testing/manual-e2e-checklist.md@@ -518,7 +518,8 @@ The agent may only call the fixed tool set in [ai-agent.md](../architecture/ai-a- [ ] Confirm the edit produced by that auto-enhance request can be rewound like any other turn.- [ ] Choose *Smart cuts* with no provider connected and confirm the setup view appears instead of a failed send.- [ ] Choose *Automatic zooms* and confirm it adds zooms without involving the provider.-- [ ] Restart the app and confirm conversations are gone while the provider configuration persists; this is a known gap, not a defect to file.+- [ ] Restart the app, reopen the project, and confirm its conversations come back with their titles and messages while the provider configuration persists; rewind controls on messages sent before the restart are hidden, which is a known gap, not a defect to file.+- [ ] Delete a project from the open-project dialog and confirm its `<projectId>.chat.json` is gone from `userData/projects`.- [ ] Confirm the provider API key is never displayed in the settings form after it is saved.## Native compositor preview and export — v1.8.0