# ADR-0014: Console v2 chat surface is the embedded ttyd terminal only

**Status:** Accepted
**Date:** 2026-05-07
**Deciders:** JT, Claude (in dialogue, dual-consult round Console v2 + Engine Overhaul)
**Supersedes:** none directly; locks rejection of the HTTP-based chat (`ChatPanel.tsx`, `chat_routes.py`, `slash_dispatch.ts`) and the `useEventStream` chat fork.
**Superseded by:** none

## Decision

Console v2's chat surface is the embedded ttyd terminal — `ChatColumn.tsx` mounting a `TerminalIframe.tsx` around a ttyd port that hosts `claude --resume <session>`. This is the only chat surface.

The HTTP-based chat — `ChatPanel.tsx` (React component), `chat_routes.py` (FastAPI router), `slash_dispatch.ts` (frontend dispatch shim) — is **deleted in CP-C Phase 17**. `chat_routes.py` was never registered in `main.py`'s router list, so the deletion is byte-safe at the API boundary.

Revisit only if ttyd proves uninstallable on a target machine. Until then, no parallel HTTP chat path is to be reintroduced.

## Context

An HTTP-based chat (textarea + SSE wrapper hitting `chat_routes.py`) was prototyped during embedded-claude-terminal Phase 8 alongside the ttyd embed. The HTTP path was wired into the frontend (`ChatPanel.tsx` rendered, `slash_dispatch.ts` imported) but `chat_routes.py` was never added to `main.py`'s router registration — so the frontend pieces dispatched into a 404 the entire time. Two chat surfaces in the same codebase produced bus-event divergence (the HTTP path emitted on its own surface, ttyd emitted through the IPC bridge), and the duplicate kept showing up in audits as "did we mean to ship this?" friction.

SYNTHESIS.md §1 lock U-4 (Hybrid A canonical) and the §6 chat-fork decision converge: ttyd is the canonical chat surface for Console v2, and the HTTP duplicate gets deleted, not gated, not feature-flagged. ADRs 0006–0008 already lock the ttyd substrate, IPC bridge, and chat-session-per-project model; this ADR closes the loop by retiring the parallel path.

## Consequences

- CP-C Phase 17 deletes `recoil/console-v2/.../ChatPanel.tsx`, `recoil/api/chat_routes.py`, and `recoil/console-v2/.../slash_dispatch.ts`.
- The `recoil/console-v2/.out-of-scope/api-based-chat.md` file durably records the rejection (Law 14).
- ADR-0006 (embedded ttyd), ADR-0007 (chat-sessions.json), ADR-0008 (MCP-FastAPI IPC bridge) remain in force; this ADR is the "no parallel HTTP chat" complement to those.
- Cited Laws: Law 1 (SSOT — one chat surface), Law 13 (deletion test — the HTTP path's complexity does not reappear without it), Law 14 (anti-pattern memory), Law 15 (ADRs).
- Related ADRs: ADR-0006, ADR-0007, ADR-0008, ADR-0011 (Hybrid A canonical).
