docs(spec): Phase 2 design — unified agent panel + 2a plan#204
Merged
Conversation
Design for merging CastCodes' two AI-conversation panels (the shipped
ai_assistant/Familiar daemon panel and the feature-flagged cli_chat
OSC-777 panel) into one surface. A new app/src/agent_panel hosts a
conversation model generalized over a ConversationBackend enum
(Cli(AgentKind) | Daemon{harness}), fed by two sources (CLIAgentSessions
+ a Coven-daemon source), persisted in the existing sqlite ChatStore
(add a backend column; non-destructive idempotent migration of
stream-history.json), with one composer routing per backend and one
entry point. Backend picker + native mechanics (daemon headless-in-panel,
CLIs stay in a terminal pane); OSC-777 retirement deferred to Phase 3.
Both old panels deprecated behind a flag, deleted after parity.
…migration)
Bite-sized TDD plan for 2a: add a ConversationBackend enum
(Cli(AgentKind)|Daemon{harness}), generalize ChatConversation over it, a
schema v2 `backend` column migration, and a non-destructive idempotent
stream-history.json -> sqlite data migration. Behavior-preserving for the
CLI path (cli_chat suite gates it). 2b-2d get their own plans after 2a.
Contributor
There was a problem hiding this comment.
Pull request overview
Design/spec documentation for Phase 2 of reconciling CastCodes’ two agent conversation surfaces, proposing a new unified agent panel architecture and a TDD plan for sub-phase 2a (shared conversation core + persistence/migration groundwork) without landing implementation.
Changes:
- Adds a Phase 2 design doc describing the unified agent panel architecture (backend picker, unified list/history/store, staged deprecation).
- Adds a Phase 2a implementation plan to generalize
cli_chatover aConversationBackendenum and migrate~/.coven/stream-history.jsoninto sqlite.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| specs/castcodes-unified-agent-panel/DESIGN.md | Defines the Phase 2 unified agent panel architecture, data flow, risks, and staged rollout approach. |
| specs/castcodes-unified-agent-panel/PLAN-2a.md | Provides a task-by-task TDD plan for Phase 2a: backend enum + schema/store changes + stream-history migration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| 3. **Persistence** — the existing sqlite `ChatStore`, extended: | ||
| - Schema migration (`chat_schema_version` bump): add a `backend` column to `chat_conversation` (`'cli'` for existing rows, `'daemon'` for coven-code). `agent` continues to carry the harness/kind name. | ||
| - One-time, **non-destructive, idempotent** data migration: read `~/.coven/stream-history.json` (`{conversation_id, text}` records), insert each as a `coven-code` `Daemon` conversation with a single `AssistantResponse` entry, then rename the file `.migrated` (never delete user data). Guarded by a migration marker so it runs once. |
Comment on lines
+191
to
+193
| // Apply only version 1, insert a legacy row, then migrate to current. | ||
| conn.execute_batch(super::super::store_schema::V1_FOR_TEST).unwrap(); | ||
| conn.execute( |
| let _ = std::fs::rename(&path, path.with_extension("json.migrated")); | ||
| } | ||
| ``` | ||
| Confirm `ChatStore::insert_entry` uses `INSERT OR IGNORE` (or add `OR IGNORE`) so re-inserting `sequence = 0` is a no-op — verify against `store.rs` line ~72 (`insert_entry`); if it's a plain `INSERT`, change to `INSERT OR IGNORE` for idempotency. |
This was referenced Jul 18, 2026
Merged
This was referenced Jul 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Design/spec PR for review — no implementation. Phase 2 of the Coven agent-surface reconciliation: merge CastCodes' two AI-conversation panels into one unified panel.
Phase 1 (#201) made both surfaces render through the shared
agent_transcriptmodule. They still diverge everywhere else: the shippedai_assistant/Familiar panel (Coven daemon,stream-history.json, "Coven Sessions" list) vs. the feature-flaggedcli_chatpanel (OSC-777 CLIs in a terminal, sqlite, conversation list, model picker, composer).Two documents under
specs/castcodes-unified-agent-panel/:DESIGN.mdapp/src/agent_panelhosting a conversation model generalized overConversationBackend { Cli(AgentKind) | Daemon{harness} }, fed by two sources (CLIAgentSessions + a Coven-daemon source), one sqlite store (add abackendcolumn; non-destructivestream-history.jsonmigration), one composer routing per backend, one entry point. Backend picker + native mechanics (daemon headless-in-panel, CLIs stay in a terminal pane); OSC-777 retirement stays deferred to Phase 3. Both old panels deprecated behind a flag, deleted after parity.PLAN-2a.mdcli_chat's suite).What I'd like reviewed
ConversationBackend.stream-history.json→ sqlite migration — non-destructive (rename to.migrated, one text blob → oneAssistantResponseentry). OK, or drop the old text history and start fresh?Non-goals of this PR
Linked Issue
Continues the reconciliation roadmap (
specs/castcodes-coven-agent-transcript/, Phase 1 shipped in #201). No separate tracking issue.ready-to-specorready-to-implement.Testing
./script/check_ai_attribution+./script/check_rebrandpass../script/run(n/a — specs only).Agent Mode