Skip to content

fix(web): a new chat starts its own thread instead of appending to Myra's last one (CL-8616) - #955

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-8616-new-chat-fresh-thread
Sep 18, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-8616-new-chat-fresh-thread

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

A chat's route id used to be the agent's definition asset id, so listChats/readChat in apps/web/src/chat/threads-api.ts grouped every mail turn to that agent's address set into one conversation. Starting a chat from /chats/new sent a fresh, non-reply message, but the chats list still filed it under the agent's single existing entry, so a new question showed up appended under whatever conversation was already there.

The chat id is now the thread's root turn id (Sent:<uid> of the person's opening send), found by walking each turn's In-Reply-To/References back to a turn with no known parent (threadRootIds). listChats groups by that root instead of by agent, and readChat resolves a chat's rows and its agent from the thread rather than from an agent lookup. startChat returns the new root id from the send's own accepted response instead of the agent's asset id.

chat-thread-page.tsx's agent avatar now keys off chat.agent.id instead of the (now thread-scoped) chat.id. Updated docs/chat-mail-threading.md to describe the new keying.

Testing

  • bun run check (typecheck, lint, fmt, test) passes from the worktree root.
  • Updated apps/web/src/chat/threads-api.test.ts fixture for the new MailTurn.parentId field.

@linear-code

linear-code Bot commented Sep 18, 2026

Copy link
Copy Markdown

CL-8616

@TheGreatAxios
TheGreatAxios merged commit a638c67 into main Sep 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant