Skip to content

Chat mode v1 — follow-ups #540

Description

@kwannoel

Tracking follow-ups surfaced during the chat-mode v1 implementation on branch session-1-07ce2e (design: docs/plans/2026-04-22-chat-mode-design.md, plan: docs/plans/2026-04-22-chat-mode-plan.md).

Blockers for full e2e coverage

  • Expose read_daemon_token on the Axum test server (src-tauri/src/bin/server.rs). The browser-mode Playwright harness uses this server; without a /api/read_daemon_token route, the daemon-reachable test in e2e/specs/chat-mode.spec.ts cannot pass and is currently marked test.fixme. Removing the fixme and extending the spec with a "+ New chat" + streaming-reply scenario is the payoff.
  • After above lands, implement the third e2e scenario — create a chat via the "+ New chat" dialog, send a user message, assert user bubble + streamed agent bubble appear.

Deferred UX / error handling

  • 401 re-read-token + retry-once in the daemon error classifier (src/lib/daemon/errors.ts / ChatView / ChatInput). Today 401 shows a toast; the design doc calls for re-reading ~/.the-controller/daemon.token and retrying the request once before giving up.
  • Make "+ New chat" rows keyboard-walkable. HotkeyManager.getVisibleItems' chat branch intentionally excludes the "+ New chat" rows from j/k navigation. Enter on a walked "+ New chat" row should open NewChatDialog.
  • Dedicated Chat help section in HotkeyHelp. The mode label already switches to "Chat"; a full section (send / interrupt / navigate) requires registering chat-specific commands in the keymap (src/lib/commands.ts + wherever getHelpSections lives). Today users only see the global shortcuts in chat mode.

Pre-existing svelte-check errors

Not introduced by this work but worth clearing to keep the suite clean:

  • src/lib/IssuesModal.svelte:297MouseEventHandler type mismatch (pre-existing on main).
  • src/lib/daemon/client.test.ts:26 — two tuple-index errors (const [url, init] = fetchMock.mock.calls[0]). Introduced by Task 6 of the chat plan. Doesn't fail tests; just svelte-check noise.

Quality polish (non-blocking)

  • Error toast on failed tool-approval submit. ToolApprovalBlock currently try/finallys the send — errors are silently swallowed. A toast via classifyError + showToast would match how ChatInput handles failures.
  • Trim whitespace in initial_prompt / tool approval reason. Current check is empty-string only; " " still gets sent.
  • Prune orphaned transcripts in loadSessions. Today it only initializes emptyTranscript() for new sessions; sessions removed on the daemon don't have their transcripts GC'd.
  • Virtualize Transcript.svelte once transcripts grow large. Plain scroll for v1 per the design doc.

Architecture follow-ups

  • Auto-start the daemon from the Tauri app (the "like a language server" option from the brainstorm). v1 is manual; auto-start requires process supervision, bundling, and upgrade plumbing.
  • Tracking issue for the fixme test — once /api/read_daemon_token is exposed, un-fixme in e2e/specs/chat-mode.spec.ts and tune the 1500ms daemon-readiness sleep (likely flaky on slow hardware).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions