summaryrefslogtreecommitdiffhomepage
path: root/tasks.md
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-22 02:29:23 +0900
committerAdam Malczewski <[email protected]>2026-06-22 02:29:23 +0900
commitd233842752d32659bba6f0e47b536e50d03145aa (patch)
tree2c24978dc4d0d360db3b1bd65e8647c1b1d14121 /tasks.md
parentae8f61cefd383417bc0f80447d7ab1bfdfe0726d (diff)
downloaddispatch-d233842752d32659bba6f0e47b536e50d03145aa.tar.gz
dispatch-d233842752d32659bba6f0e47b536e50d03145aa.zip
docs: mark roadmap items 9 (tab persistence) + 10 (compacting) as DONE
Also adds bin/sync-env script for updating system env keys.
Diffstat (limited to 'tasks.md')
-rw-r--r--tasks.md86
1 files changed, 16 insertions, 70 deletions
diff --git a/tasks.md b/tasks.md
index 4f9321c..ec90cf2 100644
--- a/tasks.md
+++ b/tasks.md
@@ -577,75 +577,21 @@ conversation tab. Short-ID prefix resolution (4+ chars → full ID via `GET /con
model, end-to-end. The logic is unit/integration tested + boot-smoke-clean;
this is the live end-to-end smoke. Blocked on the frontend wiring the queue
surface + `chat.queue` op (or run it backend-only with a probe client).
- 9. **Tab persistence across devices (conversation lifecycle):** conversations
- need a lifecycle status so a new browser connection can restore the user's
- tab state. Three states:
- - **`active`** — an agent is currently connected and generating (live stream
- in progress).
- - **`idle`** — conversation exists, not actively generating. User can send a
- message to resume.
- - **`closed`** — user dismissed the tab (hidden from the tab bar, but the
- conversation is not deleted — can be reopened from history).
-
- On browser connect, the frontend fetches all `active` + `idle` conversations
- and restores the tab bar. `active` tabs reconnect to the live stream;
- `idle` tabs load their history. `closed` tabs are hidden unless explicitly
- reopened from a conversation list/history view.
-
- **Backend work:**
- - Add `status: "active" | "idle" | "closed"` to `ConversationMeta` (wire type).
- - Track status transitions: `idle → active` on turn-start, `active → idle` on
- done/error, `idle → closed` on user close.
- - `POST /conversations/:id/close` to mark closed (already exists for
- aborting turns — extend or add a separate endpoint for status).
- - `GET /conversations?status=active,idle` filter on the list endpoint (or
- default to excluding `closed`). CLI `dispatch list` also defaults to
- `active,idle`; add `--status <state>` flag to filter by a single state,
- and `--all` to include closed.
- - WS broadcast `conversation.statusChanged` so all connected clients update
- their tab bars in real time.
- - Persist status in the conversation store (in-memory for now, same as other
- metadata; `createdAt`/`lastActivityAt`/`title` pattern).
-
- **Frontend work:**
- - On connect: fetch conversations, restore tab bar from `active` + `idle`.
- - `active` tabs: reconnect to live stream (subscribe to WS events for that
- conversation).
- - `idle` tabs: load history via `GET /conversations/:id`.
- - Tab close button → `POST /conversations/:id/close` → mark `closed` →
- remove from tab bar (but not from history).
- - Listen for `conversation.statusChanged` WS messages to sync tab state
- across devices.
- 10. **Conversation compacting:** summarize/compress conversation history to
- reclaim context window without losing the thread. Two modes:
- - **Automatic (token-threshold):** a setting (per-conversation or global)
- that triggers compaction when `contextSize` reaches a configurable token
- count (e.g. 100k). When the threshold is hit, the backend summarizes the
- conversation history (excluding the most recent N messages) and replaces
- the old history with the summary + recent messages.
- - **Manual (button click):** a frontend button that triggers compaction on
- demand for the current conversation, regardless of token count.
-
- **Backend work:**
- - `POST /conversations/:id/compact` endpoint — triggers compaction.
- - Compaction logic: call the model with a summarization prompt over the
- conversation history, produce a summary, then replace old chunks with a
- single system-injected "conversation summary" chunk + retain the most
- recent N messages (configurable, default ~10).
- - Settings: `compactThreshold` (token count, 0 = disabled) stored per
- conversation or as a global default. Exposed via settings/config.
- - Automatic trigger: check `contextSize` after each turn; if it exceeds
- `compactThreshold`, run compaction before the next turn starts.
- - Emit a `conversation.compacted` WS event so the FE can refresh history.
- - Journal/span for compaction (observable: what was summarized, tokens
- saved).
-
- **Frontend work:**
- - Settings UI for `compactThreshold` (number input, 0 = manual only).
- - Compact button in the conversation toolbar (triggers
- `POST /conversations/:id/compact`).
- - Handle `conversation.compacted` WS event to reload history.
- - Show a visual indicator that a conversation has been compacted (e.g. a
- badge or divider showing where the summary begins).
+ 9. ~~**Tab persistence across devices (conversation lifecycle)**~~ — **DONE**.
+ Conversations have `status: "active" | "idle" | "closed"` on `ConversationMeta`.
+ Orchestrator transitions: `idle → active` on turn-start, `active → idle` on
+ settle, `→ closed` on close. `conversation.statusChanged` WS broadcast.
+ `GET /conversations?status=` filter. CLI `dispatch list` defaults to
+ `active,idle`; `--status`/`--all` flags. FE handoff:
+ `frontend-conversation-lifecycle-handoff.md`.
+ 10. ~~**Conversation compacting**~~ — **DONE**. Non-destructive: forks old history
+ to a new archive conversation (new UUID), replaces the original conversation's
+ history with `[system: summary] + recent N` (ID stays the same so messaging
+ is unaffected). `compactedFrom` chains backward: A → Y → X. Manual via
+ `POST /conversations/:id/compact`; automatic after turn settles if
+ `compactThreshold` (default 350k) is exceeded. `GET/PUT
+ /conversations/:id/compact-threshold` for the setting. `conversation.compacted`
+ WS broadcast. CLI `dispatch compact <id>`. FE handoff:
+ `frontend-compaction-handoff.md`.
(Done and dropped from the list: CLI; dedup / storage growth; message queue + steering injection.)