New Tab: a model pick no longer adds an empty chat to Chats

Merged
TE
18d ago
+56-1

On a New Tab, open the model chip and pick a model without sending anything. An empty "New chat · now" row appears at the top of the New Tab's Chats list, and every other chat moves down a row.

The first chip pick on a New Tab starts the chat's session through a deferred chat.new, so the pick has a session to land on. acpmux lists that session at once, with lastPrompt: null and turnCount: 0, and the New Tab's recent chats (recentSessions, used by recentChatCards and the older New Tab page) showed it like any other chat.

A session acpmux reports with an explicit lastPrompt: null and no completed turn is now marked unsent in sessionList.ts, and the New Tab's recent chats skip it. The session itself is still created, so the pick keeps working. A chat whose first prompt is queued, waiting on the person (a permission, an answer) or starting its turn still counts as sent and stays listed (review follow-up 839035149ae). A disconnected or closed empty chat is still unsent; only running or waiting counts as a first turn under way. A summary from an older daemon or a fixture that leaves out lastPrompt is unchanged.

Found in a click-through pass on cmux16 (tagged build of feat-cmux-next c25d784). The newtab-projects lane confirmed it's outside its area and suggested filtering rather than not creating the session.

Verification

  • bun test test/new-tab-recent-sessions.test.ts: "stays off the recent chats" fails on the test commit (the unsent chat is listed) and passes with the fix. "a chat whose first prompt waits is still a recent chat" fails on the first fix and passes with the follow-up.
  • bun test test/new-tab-*.test.ts* test/*session*.test.ts* test/*recent*.test.ts*: 82 pass, 12 skip (browser lane), 0 fail.
  • bun run typecheck: no errors.
  • Not re-checked live yet. All Chats loads through the host's chats.page, which this doesn't change.

Changelog

Fixed: picking a model on a New Tab no longer adds an empty chat to its Chats list.

🤖 Generated with Claude Code