AI panel chat threads
The AI panel: Chat tab persists every conversation as a thread. Threads survive project close, app restart, and sync.
Where threads live on disk
<project>/.novelty/ai-threads/<thread-id>.json — one JSON file per thread. Versioned by the project’s hidden git history, so a snapshot or sync rolls forward both manuscript and chat together.
The renderer never writes mid-stream. Only settled messages reach disk:
- A user turn lands the moment you press Enter.
- An assistant turn lands when the stream finishes (Done) or errors out.
- An Edit Mode card / tool-activity card / review card lands when its status flips off
running. - A fanout card lands when the suggestions resolve.
If you cancel a streaming reply, the partial assistant turn is dropped — nothing half-finished sits in the file.
Switching, naming, deleting
The chat tab header carries a thread switcher:
- Active title — click to rename. Enter commits, Esc cancels. Empty title is treated as “untitled”.
- ▾ N — open the thread popover. Click any row to switch. Hover the row’s
×to delete (with a tiny inline confirm — no modal). The active thread row is shown with a hairline highlight. - + new — start a fresh thread. The current thread keeps its history; the new one starts empty.
Switching threads cancels any in-flight reply on the previous thread before loading the new one.
Auto-naming
When you send your first message in a fresh thread, a single Haiku pass turns the message into a 3-5 word title. The placeholder (“New chat”) gets replaced quietly in the background — you don’t have to wait for it. If the model fails or your OpenRouter key is missing, the placeholder stays.
If you renamed the thread yourself before the first send, your label is preserved — auto-naming only fires when the title is still the default.
Empty threads
Threads with no messages show as “empty” in the popover. They’re kept until you delete them, so you can pre-create a few and switch into them by name.
Command palette
AI panel: new chat threadAI panel: rename current chat thread…AI panel: delete current chat threadAI panel: switch chat thread…
All four register on app start; the rename / delete entries gate on having an active thread.
Cost
Auto-name is a single Haiku call. Title pass cost is trivially small and is not logged in the usage dashboard — the per-thread overhead would crowd the chart with cosmetic rows. Real chat turns continue to log normally.