Skip to content

feat(site/src): render the chat tree sidebar and relayed messages behind the chat-tree experiment - #29618

Closed
jscottmiller wants to merge 6 commits into
scott/chat-tree/3-messagingfrom
scott/chat-tree/4-ui
Closed

jscottmiller wants to merge 6 commits into
scott/chat-tree/3-messagingfrom
scott/chat-tree/4-ui

Conversation

@jscottmiller

Copy link
Copy Markdown
Contributor

Behind the chat-tree experiment, the agents sidebar renders the owner's chats as a tree fed by GET /organizations/{org}/chats/tree (one query per organization, the flat list kept only for chats shared with the viewer), and the transcript renders PR3's relayed rows and the send_chat_message / list_chat_tree tool calls. With the experiment off the sidebar, the create form, and the transcript are unchanged and no tree endpoint is called. Stacked on #29617 (scott/chat-tree/3-messaging), which sits on #29615 and #29614.

The tree is a WAI-ARIA navigation treeview: the row anchor is the treeitem (client-derived aria-level, filter-aware aria-setsize/aria-posinset, aria-expanded, aria-current="page" for the open chat), children sit in role="group", one roving tab stop, arrow keys, Home/End, *, and type-ahead through a pure reducer. Expansion and per-node "Show subagents" are persisted in agents.chat-tree-expanded; ancestors of the open chat expand once per navigation. Pinned chats stay a flat section above the tree (dnd-kit reordering kept, grip handle isolated from the row link); shared chats are a flat section below it. The unread/read filter is a client-side predicate that keeps matching nodes and their ancestors (ancestors dimmed and force-expanded); groupBy and PR-status filters are hidden in tree mode because tree rows carry no diff_status. "New chat here" routes to the composer with router state and shows a dismissible "New chat under <title>" chip; the parent id is sent only when the parent's organization is available to the form. Archiving a chat with named descendants asks for confirmation in the layout, so the top bar and the tree share one dialog. Tree cache maintenance (watch events, optimistic pin/rename/archive/reorder patches, refetch cancellation) lives in api/queries/chats.ts under a key family that never overlaps the list caches.

The first commit fixes three PR1/PR2 sweep misses in existing components that inferred "subagent" from parent_chat_id (ChatActionsMenuItems, ChatTopBar, getChatCostTreeID); with the experiment on every adopted chat has a parent, so those gates hid pin, archive, and share for all user chats. The last commit applies the diff panel review (table below).

Notes for reviewers:

  • Backend follow-ups, not worked around here: tree rows carry no diff_status (no PR badges or PR filter in tree mode) and no subagent_count (the "Show subagents" toggle is offered on every named node without a count, and subagents are fetched per toggled node through GET /chats/{id}).
  • The legacy SortableChatTreeNode (experiment off) still starts a keyboard drag on Enter; the new SortablePinnedChatRow fixes that only for tree mode and is a back-port candidate.
  • frontend-review justifications: ChatActionsMenuItems.test.tsx asserts the set of rendered menu items per chat kind; the item set is the outcome of the kind gate and there is no ChatActionsMenuItems story to screenshot it. The Revoked Selection Does Not Resurrect story in AgentCreateForm.stories.tsx fails locally in this environment with a proxied 502 on the base branch as well; it is not touched by this PR.
  • One behavioural delta from sharing the empty state with ChatsPanel: a lingering PR-status filter in the URL now yields "No agents match these filters" plus "Clear filters" in tree mode instead of being ignored.
  • RTL mapping for Left/Right in the tree is a noted follow-up.

Screenshots (Storybook)

Story
ChatTreePanel/Expanded Expanded tree
ChatTreePanel/StatusIndicators Status indicators
ChatTreePanel/DeepTree Five levels
ChatTreePanel/DepthLimitDisablesCreate Depth limit menu
ChatTreePanel/ContextMenuOpen Context menu
ChatTreePanel/PinnedSection Pinned section
ChatTreePanel/ArchivedForest Archived forest
ChatTreePanel/UnreadFilterDimsAncestors Unread filter
ChatTreePanel/SubagentsShown Subagents shown
ChatTreePanel/MultipleOrganizations Multiple organizations
ChatTreePanel/KeyboardFocusRing Keyboard focus ring
ChatTreePanel/Mobile Mobile
SendChatMessageTool/Queued send_chat_message queued
SendChatMessageTool/ErrorResult send_chat_message error
ListChatTreeTool/WithParentAndChildren list_chat_tree
ListChatTreeTool/ErrorResult list_chat_tree error
ConversationTimeline/RelayedMessageFromChild Relayed message
AgentCreateForm/WithParentChat New chat under a parent
AgentCreateForm/WithParentChatInUnavailableOrganization Parent organization unavailable
Diff review dispositions (panel review, applied in the last commit)

N11 rejected; N5 accepted for the persisted preference and rejected for the org-change reset. All others accepted as written.

# Reviewer Severity Location Finding Disposition Action
1 Noor high chats.ts applyWatchedChatCreatedOrUnarchived applyChatArchiveStateToCaches(false) runs before the tree created helper, so the archived-tree probe never sees the row and an unarchive is appended as a new chat with child_chat_count + 1. accept Run the tree helper before the archive-state pass and treat cachedChat?.archived as an unarchive signal; add a wrapper-level test.
2 Noor high AgentsPageLayout.tsx merge path No cancelChatTreeRefetches before mergeWatchedChatIntoCaches; the has_unread effect invalidates every tree on navigation so a stale refetch reliably races the new chat's title_change. accept Call cancelChatTreeRefetches next to cancelChatListRefetches in the watch handler; drop the later calls inside the helpers.
3 Noor medium AgentsPageLayout.tsx chatList Tree responses are depth-ordered and include the root, so the search dialog's Recent list shows the root first and is not recency-ordered. accept Filter kind === "root" and sort by updated_at desc when building chatList in tree mode.
4 Noor medium chats.ts createChat.onSuccess No tree invalidation; a new chat appears only via the watch event. accept Add invalidateChatTreeQueries(queryClient, { organizationId }).
5 Noor medium AgentCreateForm.tsx parent org parentOrg overriding effectiveOrg triggers the org-change reset and persists the parent's org as the stored preference; dismissing flips back. accept (persist), reject (reset) Exclude parentOrg from the adopt/persist logic. The workspace/MCP reset on org flip is the same rule as a manual org change and a selection from another org is invalid for the parent's org.
6 Noor medium AgentsPageLayout.tsx archive-and-delete onSuccess/onError invalidate the list but not the tree. accept Add invalidateChatTreeQueries to both.
7 Noor low AgentsPageLayout.tsx sidebarLoadError A failing shared list hides a loaded tree; a single failing org with others loaded is dropped silently. accept (partial) Show the error alert only when no tree data loaded; a loaded tree is never hidden by the shared list error. Per-section inline errors are a follow-up.
8 Noor low chats.ts created append Appended rows get depth: undefined, so the depth limit is not enforced on fresh rows until refetch. accept Set depth = parent.depth + 1 when the parent carries a depth.
9 Noor low watch handler churn Owned created events refetch the shared list; cascade deleted events restart the archived-tree refetch per member. accept (partial) Skip the list invalidation for owned created events in tree mode. The per-member archived invalidation is cheap and kept.
10 Noor low AgentCreateForm.tsx Parent org not in permittedOrgs after settle still sends parent_chat_id with a different organization. accept The form resolves the parent and passes parentChatId in CreateChatOptions only when parentOrg resolved; the page reads it from the options. Show an info alert when the parent's organization is not available.
11 Noor nit chats.ts cancelChatTreeQueries in onMutate Cancels a first-ever tree fetch. reject Parity with the list mutations; recovered by onSettled invalidation.
12 Ravi high ChatTreePanel.tsx auto-expansion setExpansion is called during ChatTreeBody's render but the state belongs to ChatTreePanel (React warns and the update is deferred). accept Move the model build and the active-chat auto-expansion into the component that owns expansion; the body receives model and expansion as props. Add a Vitest for auto-expansion.
13 Ravi high ChatTreeRow.tsx actions trigger `tabIndex={isFocused isActiveChat ? 0 : -1}` yields two tabbable triggers whenever focused differs from active.
14 Ravi high (latent) ChatTreePanel.tsx pendingFocus A failed archive leaves pendingFocus set forever and onMenuCloseAutoFocus then drops focus to body on every menu close. accept Remove the preventDefault path: Radix returns focus to the still-mounted trigger at close time, and FocusAfterRemoval moves focus once the row is gone. Clear pendingFocus when the user focuses another row.
15 Ravi medium ChatTreePanel.tsx FocusAfterRemoval The rows snapshot is taken in an effect after setPendingFocus, depending on the optimistic removal landing in a later tick. accept Snapshot keyboardRows synchronously in removeRowWithFocus and store them in the pending state.
16 Ravi medium ChatTreeRow.tsx actions trigger opacity-0 until hover means an invisible tappable area on coarse pointers. accept Visible by default; hidden only under [@media(hover:hover)] until hover or focus, mirroring the chevron.
17 Ravi medium ChatTreeRow.tsx chevron Clicking the chevron moves DOM focus to a tabIndex=-1 button outside the treeitem, breaking the key handler; a button is not valid tree content. accept onPointerDown preventDefault, focus the row's treeitem after toggle, aria-hidden on the chevron (the treeitem's aria-expanded and the menu's Expand/Collapse cover it).
18 Ravi medium AgentCreateForm.tsx chip Dismiss button is 16 px and unmounts itself without a focus handoff. accept size-6 target; move focus to the message textbox on dismiss.
19 Ravi low force-expanded ancestors Live Collapse chevron and menu item that do nothing under a filter. accept Hide the chevron and omit onToggleExpanded for force-expanded rows.
20 Ravi low treeKeyboard.ts Enter open branch is unreachable from the panel. accept Remove the branch and its test; Enter is native anchor activation.
21 Ravi low ChatTreePanel.stories.tsx Mobile Story decorator nests inside the meta 320 px frame; hover media query not emulated. accept (partial) Size the frame from a story parameter so Mobile renders at 360 px. Touch emulation for Pixel is not available; noted in the story.
22 Ravi low pinned section under filter Pinned rows ignore the status filter while reordering is disabled. accept Filter pinned rows through the visible set when a filter is active.
23 Ravi low tests and stories Assertion proxies (aria-label text, aria-disabled, unrelated constant), missing coverage for auto-expansion, *, organization node toggle, Show subagents, dialog cancel focus, new menu items; missing stories for filter-empty, context menu, collapsed organization. accept (partial) Fix the assertions and add the listed tests and stories. A dnd-kit keyboard drag payload test is skipped: the reorder handler is unchanged from the legacy panel.
24 Ravi nit ChatTreeRow.tsx icon labels role=img status icon prefixes the treeitem name, so type-ahead letters do not match what is announced. accept aria-hidden icon plus an sr-only status suffix after the title.
25 Elena medium ListChatTreeTool.tsx Error results render a success-shaped body ("No parent", "No active child chats"). accept hasContent={!isRunning && !isError} and a failure label; distinguish missing payload from parent: null.
26 Elena medium ChatTopBar.tsx archive The top bar archives a named parent with no cascade confirmation; the client block check only inspects subagents. accept Lift the cascade confirmation to the layout's requestArchiveAgent (tree mode, child_chat_count > 0 or cached named descendants) so the top bar and the tree share one dialog; the panel keeps only focus handling.
27 Elena medium child count hint and confirm child_chat_count includes archived children, so a collapsed node with only archived children shows "1 chats" with no expander and the confirm prompts for nothing. accept Hint from model children in the active view; confirm only when named descendants exist in the model or cached tree rows.
28 Elena low ChatActionsMenuItems.tsx unarchive Unarchive offered on a child whose parent is archived; the server rejects it. accept Pass isParentArchived from the row and hide the item.
29 Elena low SendChatMessageTool.tsx label maps in and bare indexing on plain-object maps accept prototype keys. accept Use Object.hasOwn.
30 Elena low ListChatTreeTool.tsx updated_at Unparseable timestamps render "NaNy". accept Guard with a validity check before formatting.
31 Elena low Tool.tsx SendChatMessageRenderer Error results fall back to args.chat_id for the link, which may be arbitrary model output. accept Fall back to args only when not an error.
32 Elena nit AgentsPageLayout.test.ts Subagent cost cases use kind: "chat". accept Set kind: "subagent".
33 Elena nit ListChatTreeTool.tsx detail Empty detail renders " ()"; self.kind ?? "chat" hides a missing field. accept Omit the detail span when empty; show "Unknown" for a missing kind.
34 Elena nit testHelpers/chatEntities.ts Tree fixtures omit root_chat_id. accept Set root_chat_id to the chat's own id on root/chat fixtures.
Implementation plan (chat-tree-ui)

Plan: chat-tree-ui

Project chat-tree-ui (implement-medium). Repository coder/coder, frontend only (site/src).
Branch scott/chat-tree/4-ui, based on scott/chat-tree/3-messaging (PR #29617, head 92b9504510;
PR #29615 and PR #29614 below it). Draft PR with label experimental after the step 6 checkpoint.

Revision 2: incorporates the plan panel review (REVIEW-plan.md, findings #1-#26).
Revision 3: folds in the orchestrator's step 3 decisions (see Decisions and constraints).

Decisions and constraints (step 3 checkpoint, orchestrator)

  1. Root display: stored title verbatim with the house icon; rename stays available on the root.
  2. Subagents: per-node lazy toggle without counts. subagent_count on tree rows is a backend
    follow-up, not this layer.
  3. No inline type-to-filter box. Cmd+K remains the search.
  4. Archive confirmation only when the node has named descendants.
  5. groupBy and prStatuses hidden from the filter popover while the tree is on.
  6. "New chat here" goes through the composer with router state.
  7. aria-current="page" only on treeitems; no aria-selected.
  8. diff_status on tree rows stays a backend follow-up (PR filter and badges hidden in tree
    mode). The double-encoded tool errors are being fixed in PR3: the send_chat_message
    renderer must NOT unwrap a nested JSON string; it reads { error, chat_id?, title? } directly
    from the result. Before pushing, fetch scott/chat-tree/3-messaging, rebase onto its new head,
    and rely on the corrected shape. If the PR3 fix has not landed at step 7, report instead of
    working around it.

All REVIEW-plan.md dispositions stand as recorded.

Scope

Behind the chat-tree experiment, replace the flat chat list in the agents sidebar with a tree
rendered like an IDE file panel, fed by GET /organizations/{org}/chats/tree. Add transcript
rendering for PR3's sender-chat message part and the send_chat_message / list_chat_tree
tool calls. With the experiment off, the sidebar and the transcript are unchanged and no tree
endpoint is called.

Out of scope: drag and drop or move between parents (dnd-kit reordering of the pinned section
stays as is), new backend fields or endpoints, a label filter UI (none exists today), changes to
the chat search dialog's server query.

Fixed constraints (PR2 Invariants and API contract, PR3 UI contract)

  • Chat.kind is root | chat | subagent. Tree root located by kind === "root"; root_chat_id
    is the subagent family root and is never the tree root. Never infer "subagent" from
    parent_chat_id.
  • GET /organizations/{org}/chats/tree?archived= returns { root_chat_id: string | null, chats: Chat[] }: root and chat rows owned by the caller, sorted by depth then updated_at
    desc, subagents excluded, children empty, no diff_status (tree rows are converted without
    it, db2sdk.go:2153-2161), depth and child_chat_count present on rows anchored at a root
    and absent on depth 0 rows; child_chat_count counts named children of any archive state.
    archived=true returns the root plus archived rows only, so active intermediate ancestors are
    missing and the archived response is a forest. The first call creates the root lazily and adopts
    parentless chats. root_chat_id: null means the org has no usable model config: treat chats
    as a flat list. 404 when the experiment is off.
  • POST /chats requires initial content; parent_chat_id defaults to the root when omitted.
    Depth limit ChatTreeMaxDepth = 5 (root is depth 1): a chat at depth 5 cannot have children.
  • Root cannot be archived, pinned, or shared. Archive cascades over the subtree (named children
    and subagents) and fails if any member is running, interrupting, or requires action.
    GET /chats/{chat} reports depth and child_chat_count to the owner and children =
    subagents (one level).
  • Shared-with-me chats are not in the tree response; they come from GET /chats?source=shared_with_me.
  • Watch events (/chats/watch) carry kind; root creation emits no created event.
  • Relayed user rows: a user message whose parts include { type: "sender-chat", sender_chat_id?, sender_chat_title?, sender_chat_relation?: "parent" | "child", relay_hop? } followed by text
    parts. Missing sender_chat_id means unknown sender; missing relay_hop means 1. Editing such a
    row drops the part. Queued previews carry the same parts.
  • Tool rows: send_chat_message args { chat_id, message, delivery? } (chat_id may be the
    literal parent; delivery defaults to queue), success result { chat_id (resolved UUID), title, relation, previous_status, status, delivery: started | queued | interrupting, downgraded_from?, message_id?, queued_message_id?, relay_hop }. Error results are marked
    is_error and, because the tool is outside the subagent lifecycle allowlist
    (chatprompt.go:745-752, 834-841), reach the client as { error: "<JSON string of { error, chat_id?, title? }>" }. relation is the target relative to the sender (opposite frame from
    the part). list_chat_tree result { self: { chat_id, title, kind }, parent: { chat_id, title, kind, status } | null, children: [{ chat_id, title, status, updated_at }] }; children are
    unarchived only; parent is null when there is none, it is a subagent, or it is unreadable.

What the code does today (verified on the branch)

Sidebar data flow (pages/AgentsPage/AgentsPageLayout.tsx):

  • One list query: useInfiniteQuery(infiniteChats({ archived, prStatuses, chatStatus, sources }))
    (L230-237); chatList = pages.flat() (L390). Filters come from URL params through
    getAgentSidebarFilters (utils/agentSidebarFilters.ts): archiveStatus, groupBy
    (date | chat_status), prStatuses, chatStatuses (unread | read), sources
    (created_by_me | shared_with_me, default created_by_me). No label filter exists anywhere in
    the sidebar; Chat.labels is not read by sidebar code.
  • Websocket: watchChats() handler (L558-681) writes to caches under chatListFamilyKey
    (api/queries/chats.ts L24) and chatEntityKey only: applyWatchedChatArchived (L410),
    addChildToParentInCache (L193, subagent created), prependToInfiniteChatsCache (L142),
    mergeWatchedChatIntoCaches (L633, field merge through mergeWatchedChatSummary L521),
    plus conditional invalidations. readInfiniteChatsCache (L174) feeds the chime previous status
    (L571) and reorderPinnedChat (L1565).
  • Pins, shared section, grouping are computed client side in ChatsSidebar/chats/ChatsPanel.tsx:
    buildChatTree (tree/chatTree.ts) treats list rows as roots and embeds chat.children
    (subagents, depth capped at 1); pinned = pin_order > 0 sorted; shared = shared && owner_id !== currentUserId; sections by time group or unread/read. Pinned reordering uses dnd-kit
    (SortableChatTreeNode). expandedById and collapsedSections are useState, not persisted;
    ancestors of the active chat auto expand (L248-280).
  • tree/ChatTreeNode.tsx renders a row: status icon from getChatDisplayConfig
    (tree/statusConfig.ts: waiting, running, interrupting/requires_action, error), hover expand
    toggle with aria-expanded, NavLink to /agents/:id (aria-current highlight), unread dot and
    sr-only "(unread)", shared icon, relative time, actions DropdownMenu and right-click
    ContextMenu sharing ChatActionsMenuItems. No role="tree", treeitem, or aria-level
    exists anywhere in site/src. Indent 26 px per level.
  • components/ChatActionsMenuItems.tsx: pin, rename, show/hide subagents, archive, archive and
    delete workspace. isChildChat = getParentChatID(chat) !== undefined (L97) and
    chatHasMenuActions (L55) still infer "subagent" from parent_chat_id. ChatTopBar.tsx
    L99-105 does the same (isRootChat = parentChatID === undefined, gates the share popover and
    loads the parent chat for the breadcrumb). chatHelpers.ts:97 carries the stale COALESCE
    comment PR2 deferred here. With the experiment on, every adopted chat has parent_chat_id set,
    so these three sites hide pin, archive, and share for all user chats.
  • Archive has no confirmation today (requestArchiveAgent L400-405, optimistic mutation);
    "Archive & delete workspace" uses DeleteDialog. Archive is blocked client side by
    chatFamilyAllowsArchive(status, children) with the hint "Interrupt or wait for the agent to
    finish first."; activeChatChildren (L735) feeds the top bar from chatList[...].children.
  • Create: handleNewAgent navigates to /agents; AgentCreatePage.tsx builds
    CreateChatRequest from the composer (AgentCreateForm, which owns the organization choice)
    and navigates to the new chat. The list receives the row through the created watch event.
  • Rename: RenameChatDialog lifted to the layout (chatPendingRename).
  • Mobile: no sheet or drawer. Tailwind only: on /agents (index) the composer is stacked above
    the sidebar (order-2 flex-1), on /agents/:id the sidebar is hidden sm:block
    (AgentsPageLayout.tsx L750-760, L799-809). ResizableChatsSidebarFrame applies width only at
    sm:.
  • Experiments: useDashboard().experiments.includes("...") (AgentChatPage.tsx L116);
    "chat-tree" is already in the generated Experiment union. Organizations for the page come
    from useDashboard().organizations (models are queried per org at L238).
  • localStorage keys use the agents.<kebab> prefix with guarded reads
    (ChatsSidebar/sidebarWidth.ts, utils/sidebarTabStorage.ts).
  • API client: no chats/tree call exists in api/api.ts; org-scoped precedent is
    /api/v2/organizations/${encodeURIComponent(id)}/chats/models. Generated types
    ChatTreeResponse, ChatTreeMaxDepth, Chat.depth, Chat.child_chat_count,
    CreateChatRequest.parent_chat_id, ChatSenderChatPart, ChatSenderChatRelation exist.
  • Transcript: toolRenderers: Record<string, FC<ToolRendererProps>> in
    ChatElements/tools/Tool.tsx L1175-1197, selected at L1238-1240, generic fallback
    GenericToolRenderer. toolIcons in ToolIcon.tsx; toolIconsCoverage.test.ts requires an
    icon per registered renderer; Tool.stories.tsx "all tools" story requires a showcase item per
    registered renderer. Reference renderers: ListAgentsRenderer + ListAgentsTool.tsx (parse
    with asRecord/asString/asNumber, ToolCall.Root/Header/Content, chat links through
    safeBuildAgentChatPath + Link preserving location.search).
  • User rows: ChatMessageItem (ChatConversation/ConversationTimeline.tsx L96-400) renders
    UserMessageContent (UserMessageContent.tsx, bubble with text and attachments; no author or
    avatar shown). Parts are folded by parseMessageContent (messageParsing.ts) into
    ParsedMessageContent, which already has senderChat?: ChatSenderChatPart (types.ts L69-72)
    from PR3's minimal switch case; hookNotices render as LifecycleHookNotice after the bubble
    (L273-280). Edit button gated at L300-320 with onEditUserMessage passed per row at L601.
    QueuedMessagesList.tsx getQueuedMessageInfo (L32-54) ignores sender-chat.

Design decisions

D1. Data source: one tree query per organization, list query only for shared chats

API.experimental.getChatTree(organizationId, { archived }) calls
GET /api/v2/organizations/{org}/chats/tree?archived=. Query definition chatTree(organizationId, { archived }) in api/queries/chats.ts with key chatTreeKey(organizationId, archived) = ["chats", "collections", "tree", organizationId, { archived }] and family key
chatTreeFamilyKey = ["chats", "collections", "tree"]. The key deliberately does not share the
chatListFamilyKey prefix so the infinite-list cache helpers (which assume InfiniteData<Chat[]>)
never touch it.

With the experiment on, AgentsPageLayout runs useQueries over organizations (same set the
models query uses) with chatTree(org.id, { archived: archivedFilter }), and runs the existing
infiniteChats query only when sidebarFilters.sources includes shared_with_me, with
sources: ["shared_with_me"]. With the experiment off, the layout is byte-for-byte the current
code path: infiniteChats as today, tree queries disabled (enabled: false is not enough to
avoid the hook, so the tree hook is called with an empty organization list).

Alternatives: (a) keep infiniteChats as the sole source and derive the tree from
parent_chat_id: rejected, the list excludes the root and never triggers lazy materialisation;
(b) query only the default organization: rejected, chats exist per organization and the sidebar
lists all of them today. Cost of the chosen variant: one root per organization is created on first
load in every organization the user belongs to (the backend contract), and an organization
without a model config yields root_chat_id: null and a flat list for that organization.

D2. Tree model: pure builder over parent_chat_id, flattened for rendering

tree/chatTreeModel.ts (new, pure):

  • buildChatTreeModel({ trees: { organization, response }[], subagentsByParent }) returns
    { rootIds, nodesById, childrenById, parentById } where each node is { chat, level, kind, organizationId }. Named children come from parent_chat_id. A chat whose parent is not in the
    response is attached directly under its organization's root when root_chat_id is set (the
    archived view is a forest with active ancestors missing; legacy parentless rows during the
    adoption race), or at top level when root_chat_id is null. With several organizations, each
    organization's rows sit under a synthetic organization node (div role="treeitem" aria-expanded, organization display name, Enter/Space/Right/Left toggle); with one organization
    the root is the top node. level is always derived client side; server depth is used only
    for the depth-limit check on the node itself and is treated as optional. Children are ordered as
    the response orders them (updated_at desc). Subagents (from D5) are appended after named
    children.
  • flattenVisibleTree(model, { expanded, visible }) returns the ordered list of visible rows
    { id, level, hasChildren, isExpanded, setSize, posInSet } used both for rendering and for
    keyboard navigation, so both share one definition of "visible".
  • collectMatchingChatIDs(model, predicate) returns matched ids plus all ancestors (the existing
    collectVisibleChatIDs ancestor/descendant walk generalised to a predicate); used for result
    filters (D6) and reusable for a future inline filter box.
  • childCount(model, id) and descendantCount(model, id) count named children and descendants
    present in the model. The server's child_chat_count (optional, any archive state) is used only
    for the muted "n chats" hint on collapsed nodes; it never claims those chats are all listed.

The existing buildChatTree / collectVisibleChatIDs and ChatTreeNode stay untouched for the
experiment-off path (FE3: extending them would change the legacy rendering).

D3. Rendering: ChatTreePanel with WAI-ARIA tree semantics, IDE file panel look

New components under ChatsSidebar/tree/:

  • ChatTreePanel.tsx: replaces the sections area of ChatsPanel when the experiment is on
    (ChatsPanel gets a treeData?: ChatTreePanelData prop; header, New chat, Search, filters,
    footer, loading, error, and empty states stay in ChatsPanel). Layout: Pinned section (flat
    shortcuts, dnd-kit reordering kept, ChatTreeNode rows as today so pinned rows keep their
    current look), then "Shared with you" (flat, from the list query), then the tree with
    role="tree" and aria-label="Chat tree". Pinned rows inside the panel use a new
    SortablePinnedChatRow with a dedicated grip handle (setActivatorNodeRef, dnd-kit
    attributes on the handle only, handle tabIndex following the roving rule) so the row wrapper
    is not a role="button" and Enter on the row link navigates instead of starting a keyboard
    drag. The legacy SortableChatTreeNode stays unchanged for the experiment-off path (the Enter
    hijack there is verified in step 4 and noted in the PR as a back-port candidate). Pinned and
    shared rows in the panel are not treeitems; focusedId indexes tree rows only, so the second
    aria-current="page" anchor on a pinned copy (already the case today) does not affect focus.
  • ChatTreeRow.tsx: one row. Structure: div role="none" (ContextMenuTrigger asChild, which
    adds only data-state and handlers) containing the NavLink as the treeitem (APG navigation
    treeview pattern: the anchor carries role="treeitem", aria-level, aria-setsize,
    aria-posinset, aria-expanded when it has children, aria-current="page" for the active
    chat). aria-selected is not set: it would duplicate aria-current in announcements (raised as
    open question 7). Children render in a div role="group". Indent guide lines per level
    (CHILD_INDENT_PX 16 with a 1 px guide). Chevron button with a real name ("Expand" /
    "Collapse"), tabIndex={-1}, visible on hover with [@media(hover:hover)] and always visible
    with a 24 px hit area under pointer-coarse:; "Expand" / "Collapse" is also an actions-menu
    item. Kind icon (root: HouseIcon; chat: existing status icon; subagent: BotIcon with status
    class), title, unread dot and sr-only "(unread)", relative time, pin glyph when pinned, actions
    trigger (aria-label="Open actions for <title>") and right-click ContextMenu, both through
    ChatActionsMenuItems. No PR badge or diff stats: tree rows carry no diff_status (reported
    backend gap).
  • Root display: the row shows the chat's title verbatim (backend default Root) with the house
    icon and the hint "Home" is not substituted. Rationale: the chat page header shows the same
    title, and rename works on the root, so relabeling would desynchronise the two. Alternative
    considered: show the user's name or "Home" when the title equals Root.
  • Roving tabindex: the tree keeps focusedId in component state (initialised to the active chat
    or the first row); only that row's anchor has tabIndex={0}, other anchors -1. The actions
    trigger has tabIndex={0} only on the row that holds focus or is the active chat (-1
    otherwise), so Tab from the tree goes item, its actions, out. The chevron is never in the tab
    order. This satisfies FE6 (every action reachable: arrow to the row, Tab, Enter) while keeping a
    single tab stop for the tree body.
  • Status indicators: reuse getChatDisplayConfig for waiting, running, interrupting,
    requires_action, error; unread dot as today. There is no queued hint in the current sidebar, so
    none is added.
  • Highlight: aria-current="page" from NavLink, same has-[[aria-current=page]] styling.
  • child_chat_count: shown as a muted count after the title on collapsed nodes only.

D4. Keyboard navigation reducer

tree/treeKeyboard.ts (pure): treeKeyboardReducer(rows, focusedId, key, { typeahead }) -> { focusedId?, toggle?: { id, expanded }, open?: id } implementing the APG tree pattern:

  • Down/Up: next/previous visible row. Home/End: first/last. Right: expand a collapsed node, else
    move to first child. Left: collapse an expanded node, else move to parent; on a force-expanded
    ancestor (filter active) it moves to the parent without collapsing. Enter: open (the anchor's
    native activation; the reducer returns open for parity in tests). *: expand all siblings.
    Printable characters: type-ahead over titles, cycling from the row after the focused one, with a
    500 ms buffer reset (buffer state lives in the component; the reducer is pure and takes the
    buffer as input). Right/Left are LTR; RTL mapping is a noted follow-up.
  • The onKeyDown handler on the role="tree" container acts only when event.target is a
    treeitem (anchor or synthetic organization node) and no ctrl/meta/alt modifier is held, and
    calls preventDefault on handled keys so ArrowDown from an actions trigger (Radix opens the
    menu) and Cmd+K never reach the reducer.
  • ChatTreePanel applies the result: sets focusedId, focuses the element through a ref map,
    calls toggleExpanded.

D5. Expansion persistence and subagent visibility

  • tree/chatTreeExpansion.ts: loadExpandedChatTreeIDs(orgIds) / persistExpandedChatTreeIDs
    on localStorage key agents.chat-tree-expanded storing { expanded: string[], subagents: string[] } with guarded parse (same style as sidebarWidth.ts). Default when
    nothing is stored: roots expanded, everything else collapsed. Ancestors of the active chat are
    expanded on navigation (existing behaviour, moved into the panel), and that expansion is
    persisted too. A search or result filter forces expansion of matched ancestors without
    persisting.
  • Subagents: hidden by default. Per-node toggle "Show subagents" / "Hide subagents" in the actions
    menu (the existing ChatActionsMenuItems item, now shown for every chat/root node because
    the tree response carries no subagent count). Toggling on adds the node id to the persisted
    subagents set and mounts useQuery(chatById(id)) for that node; its children (subagents)
    render as kind = subagent rows beneath the named children, with BotIcon. The active chat's
    entity is already cached by the chat page, so its subagents appear without a new request.
    Subagent created watch events are merged into the entity cache by the existing handler
    (addChildToParentInCache targets list caches only; the panel also invalidates
    chatEntityKey(parent) for toggled nodes on created).
  • Reported gap (not worked around): the tree response has no subagent count, so the toggle
    cannot show "(n)" or hide itself when a node has none, and the per-node fetch is the only
    bounded way to list subagents for arbitrary nodes. A subagent_count on tree rows would remove
    both limitations.

Alternative considered: a global "Show subagents" switch. Rejected because it needs one
GET /chats/{id} per expanded node with no way to skip nodes that have none.

D6. Pins, shared chats, filters, and search in the tree

  • Pinned: a "Pinned" section above the tree lists pinned chats as flat shortcuts (dnd-kit
    reordering preserved, same ChatTreeNode rows). Pinned chats also keep their place in the tree
    (a node may have children) and show a small pin glyph there. Pin/unpin actions are hidden for
    the root and for subagents.
  • Shared with you: flat section from infiniteChats({ sources: ["shared_with_me"] }) when the
    shared_with_me source filter is on; unchanged rows. Load-more sentinel applies to this section
    only.
  • Filters (FilterPopover): archiveStatus switches the tree query to archived=true (archived
    forest under the root, heading "Archived chats"). chatStatuses (unread/read) becomes a
    client-side predicate on the tree (D2 collectMatchingChatIDs): matching nodes and their
    ancestors stay visible, ancestors are force-expanded, non-matching ancestors render dimmed with
    an sr-only "(does not match filters)" in the treeitem name, and an aria-live="polite" region
    announces "N chats match" while a filter is active. groupBy and prStatuses are not
    applicable to the tree (no grouping; tree rows carry no diff_status), so both options are
    hidden from FilterPopover when the tree is on (treeMode prop) and ignored. sources only
    controls the shared section.
  • Search: the search dialog (Cmd+K) is unchanged; it navigates to the chosen chat and the tree
    expands its ancestors. No inline filter box is added in this layer (open question 3).
  • Labels: no sidebar label UI exists today and none is added; labels are unaffected by the tree.

D7. Actions from the tree

  • Open: click or Enter on the treeitem (native anchor navigation, preserving location.search).
  • New child chat: menu item "New chat here" on root and chat nodes. At the limit
    (depth >= ChatTreeMaxDepth) the item stays focusable with aria-disabled, a no-op onSelect,
    and the hint "Chat tree depth limit reached (5 levels)" rendered inside the item so arrow
    navigation announces it (Radix disabled items are skipped by roving focus). Because
    POST /chats requires initial
    content, the action navigates to the composer: navigate("/agents", { state: { parentChatId, parentChatTitle } }). AgentCreatePage reads location.state, passes parent_chat_id in
    CreateChatRequest, and AgentCreateForm shows a dismissible chip "New chat under <title>"
    above the composer (clearing the chip clears the parent, so the chat is created under the root).
    Router state, not a search param, so the parent does not leak into other navigation links that
    copy location.search. Also, when the experiment is on, the create form pins its organization
    selector to the parent's organization.
  • Rename: existing RenameChatDialog (works for the root too).
  • Archive: when the node has named descendants in the model (or child_chat_count > 0), a
    ConfirmDialog explains the cascade: "Archive <title> and N chats beneath it? Subagents are
    archived with them. Archiving fails if any of them is running, being interrupted, or waiting for
    approval." (N = descendantCount; when only child_chat_count is known the copy says "and the
    chats beneath it"). Confirm calls the existing archiveChat mutation. Without named descendants
    the existing no-confirmation behaviour is kept (subagents were always cascaded silently). The
    archive-blocked check extends chatFamilyAllowsArchive with the subtree statuses known to the
    model (chatSubtreeAllowsArchive); statuses of subagents that were never fetched are unknown,
    so the server rejection still surfaces through the existing toast. Root: archive, archive and
    delete workspace, pin, and share are hidden (kind === "root").
  • Focus management: archive is optimistic and does not navigate, and Radix returns focus to a
    trigger that is unmounted with the row, so the menus and dialogs opened from the tree set
    onCloseAutoFocus={(e) => e.preventDefault()}. ChatTreePanel computes the focus target
    (next visible row, else previous, else parent) before the mutation and focuses it from an effect
    keyed on the flattened rows once the removed row is gone; focusedId is never left on a removed
    id. Same rule for "Archive & delete workspace" (DeleteDialog) and unarchive in the archived
    tree. After creating a child, navigation to the new chat expands and highlights it (the existing
    auto-expand on activeChatId).
  • Archived tree: unarchive is offered on chat nodes as today; the backend rejects it while the
    parent is archived, and the error surfaces through the existing toast.

D8. Live updates

The watch handler in AgentsPageLayout gains tree cache maintenance next to the list calls,
implemented in api/queries/chats.ts so it is unit testable:

  • All tree helpers ignore kind === "subagent" events (subagents are never tree rows).
  • mergeWatchedChatIntoChatTreeCaches(queryClient, chat): for every cached tree of the chat's
    organization, replace the matching row through mergeWatchedChatSummary (status, title,
    has_unread, updated_at; diff_status is not carried by tree rows and is skipped) without
    re-sorting (position is stable within a parent).
  • created events with kind === "chat": append the row to the active tree cache of its
    organization with child_chat_count: 0, has_unread: false, no depth (levels are derived
    client side), bump the parent's child_chat_count, remove the row from cached archived trees
    (unarchive arrives as created with archived: false, once per family member) and invalidate
    them; if the parent is not in the cache, invalidate chatTreeFamilyKey. The list prepend
    (prependToInfiniteChatsCache) is skipped when the tree is on and the chat is owned by the
    current user, so owned rows do not flash into the shared list.
  • deleted (archived) events: remove the row and its descendants from the active tree cache,
    decrement the parent's child_chat_count, and invalidate the archived tree for that
    organization.
  • Refetch race: cancelChatTreeRefetches (same state.data === undefined guard as
    cancelChatListRefetches) is called next to the list cancel before every websocket write so a
    stale focus refetch cannot clobber it.
  • Mutations: pin, unpin, reorder, archive, unarchive, archive-and-delete, and rename gain tree
    analogs: cancelChatTreeQueries in onMutate, the same optimistic patch through
    updateChatTreeCaches (patchChatArchiveState, pin_order, title), and
    invalidateChatTreeQueries in onSettled / onError. getNextOptimisticPinOrder and
    reorderPinnedChat read pinned rows from tree caches when present (there is no pin watch
    event).
  • Reads: readChatFromSidebarCaches looks in the list caches then the tree caches; used by the
    chime previous-status read, chatCostIdToInvalidate, the archive-and-delete resolver
    (created_at), and the has_unread clear on navigation (which also patches the tree caches).

The tree query keeps refetchOnWindowFocus like the list. Root creation emits no watch event and
the tree GET returns it directly, so nothing else is needed.

D9. Kind-based gates in existing components (compat fixes)

  • ChatActionsMenuItems.tsx: isChildChat becomes chat.kind === "subagent";
    chatHasMenuActions likewise; add isRoot to hide pin and archive actions and show
    "New chat here".
  • ChatTopBar.tsx: isRootChat (share permission and parent breadcrumb) becomes
    chat.kind !== "subagent"; the parent chat query stays keyed on parent_chat_id but the
    breadcrumb is rendered only for subagents (a named chat's parent is a tree edge, not a spawn).
    Share popover hidden for kind === "root" (backend rejects ACL changes on the root).
  • chatHelpers.ts getChatCostTreeID: comment rewritten to the current server rule
    (root_chat_id else own id); the parent_chat_id fallback is removed since a named chat's
    parent is not its cost root (PR2 dropped the COALESCE). AgentsPageLayout.test.ts cases that
    encode the parent fallback are updated.
  • AgentsPageLayout activeChatChildren: sourced from the list when the experiment is off, from
    the entity cache (chatById(agentId).children) when it is on.

D10. Transcript: relayed rows and tool renderers

  • ConversationTimeline.tsx: when parsed.senderChat is set, UserMessageContent receives
    senderChat and renders a provenance header as the first child of the bubble column:
    ArrowLeftRightIcon, "From <title>" where the title links to /agents/<sender_chat_id>
    (through safeBuildAgentChatPath, plain text when the id is missing or unsafe, "Unknown chat"
    when the title is missing), a muted relation label ("parent chat" / "child chat"), and
    "hop N" when relay_hop > 1. The bubble gets a distinct left border (border-l-2 border-content-link) and aria-label="Relayed message from <title>" on the header group so it
    is not read as typed by the human. Edit is disabled on relayed rows (onEditUserMessage
    passed as undefined at L601 when senderChat is set, with the copy action kept).
  • QueuedMessagesList.tsx: getQueuedMessageInfo records senderChat; the preview shows the
    same "From <title>" prefix.
  • messageHelpers.hasRenderableContent: counts senderChat so a relayed row with an empty text
    part still renders its header.
  • SendChatMessageTool.tsx + SendChatMessageRenderer in Tool.tsx: header label "Message to <title>", falling back to "Message to parent chat" when `args.chat_id === "parent"` and to "Message to chat" otherwise; link to the target chat when a UUID is known (`result.chat_id`, else `args.chat_id` when it is a UUID). Body lines: target relation, delivery (`started`, `queued`, `interrupting`; `args.delivery` may be absent and means `queue`), "downgraded from interrupt" when `downgraded_from` is present, previous status and status, hop. Error results: the result is `{ error: string, chat_id?, title? }` (PR3 fix); the renderer reads those fields directly and takes the target from `args` when `title` is absent. No nested-JSON unwrapping (decision 8). The message text is shown collapsed in `ToolCall.Content` like `message_agent`.
  • ListChatTreeTool.tsx + ListChatTreeRenderer: header "Chat tree", body: parent row (kind,
    status, link) or "No parent", the chat itself, children rows (title, status icon, updated_at
    via shortRelativeTime, link). Empty children: "No active child chats".
  • toolIcons: send_chat_message -> SendIcon, list_chat_tree -> FolderTreeIcon.
    Tool.stories.tsx all-tools showcase gets both items.

D11. Experiment off

ChatsPanel receives treeData only when the experiment is on; ChatActionsMenuItems shows
"New chat here" only when onCreateChildChat is provided; AgentCreatePage sends
parent_chat_id only when router state carries one (and the experiment is on). Tool renderers and
the relayed row header are keyed on data that only exists with the experiment on, so registering
them unconditionally is safe. No tree query is constructed when the experiment is off.

Affected files

New: api/queries/chats.ts additions; api/api.ts getChatTree;
ChatsSidebar/tree/chatTreeModel.ts (+test), treeKeyboard.ts (+test), chatTreeExpansion.ts
(+test), ChatTreePanel.tsx, ChatTreeRow.tsx, SortablePinnedChatRow.tsx,
ArchiveChatTreeDialog.tsx,
ChatTreePanel.stories.tsx, ChatTreePanel.test.tsx; ChatElements/tools/SendChatMessageTool.tsx,
ListChatTreeTool.tsx (+stories); ChatConversation/SenderChatHeader.tsx;
testHelpers/chatEntities.ts fixtures (MockChatTreeRoot, MockChatTreeChild, ...).

Modified: AgentsPageLayout.tsx (+test), ChatsSidebar.tsx, chats/ChatsPanel.tsx,
filters/FilterPopover.tsx, ChatActionsMenuItems.tsx, ChatTopBar.tsx, chatHelpers.ts,
AgentCreatePage.tsx, AgentCreateForm.tsx, ConversationTimeline.tsx, UserMessageContent.tsx,
QueuedMessagesList.tsx (+test), messageHelpers.ts, tools/Tool.tsx, tools/ToolIcon.tsx,
Tool.stories.tsx, ConversationTimeline.stories.tsx, ChatsSidebar.stories.tsx.

Sequencing (commits)

  1. fix(site/src/pages/AgentsPage): key chat tree gates on kind : D9 compat fixes with tests
    (ChatActionsMenuItems, ChatTopBar, chatHelpers, AgentsPageLayout.test.ts).
  2. feat(site/src/api): add chat tree query and cache helpers : getChatTree, chatTree,
    chatTreeKey, D8 helpers with chats.test.ts coverage.
  3. feat(site/src/pages/AgentsPage/components/ChatsSidebar/tree): add chat tree model, keyboard reducer, and expansion storage : D2, D4, D5 pure modules with Vitest.
  4. feat(site/src/pages/AgentsPage): render the chat tree sidebar behind the chat-tree experiment :
    D1, D3, D6, D7, D11: panel, rows, dialogs, create-child routing, layout wiring, stories, tests.
  5. feat(site/src/pages/AgentsPage/components): render relayed messages and chat tree tool calls :
    D10.

Each commit runs pnpm check, pnpm lint:types, and the affected pnpm test files; before
handoff pnpm lint, pnpm format, pnpm test:storybook for the new story files, and the
frontend-review skill on the diff.

Testing approach

Vitest (behaviour, non-visual assertions):

  • chatTreeModel.test.ts: building from one and several organizations, root_chat_id: null
    flat fallback, orphan attachment under the root (archived child whose active parent is absent),
    subagent appending, flattenVisibleTree levels and set/pos indices, descendantCount,
    collectMatchingChatIDs ancestors and forced expansion.
  • treeKeyboard.test.ts: every key of the APG pattern, boundaries, type-ahead cycling and buffer.
  • chatTreeExpansion.test.ts: defaults, round trip, corrupt storage.
  • chats.test.ts: tree cache merge, append on created (archived tree cleaned), removal on
    archived, subagent events ignored, refetch cancellation guard, mutation optimistic patches and
    invalidations on tree caches, pinned reads from tree caches, list caches untouched by tree
    helpers and vice versa.
  • ChatTreePanel.test.tsx: arrow keys move focus (assert document.activeElement accessible
    name), Tab order (one stop into the tree, its actions trigger, out), aria-level and
    aria-expanded values after toggles, Enter navigates (assert router location), Enter on a
    pinned row navigates, toggling persists to storage, "New chat here" navigates with state and is
    aria-disabled at depth 5, archive with descendants opens the confirmation and calls
    onArchiveAgent on confirm, focus lands on the computed target after the row is removed, filter
    predicate keeps ancestors and Left on a force-expanded ancestor does not collapse it.
  • ChatActionsMenuItems / ChatTopBar tests: named child keeps pin and archive; root hides them.
  • AgentsPageLayout.test.ts: activeChatChildren source, cost id resolution without the parent
    fallback.
  • AgentCreatePage/AgentCreateForm test: parent_chat_id sent from router state and dropped
    when the chip is cleared.
  • QueuedMessagesList.test.ts: senderChat extracted. ConversationTimeline test: edit callback
    not offered for relayed rows.

Storybook (visual, setup-only play): ChatTreePanel.stories.tsx: empty tree, single root with
children, deep tree (5 levels, depth-limit menu open), collapsed and expanded, running / error /
requires_action / unread nodes, pinned section plus tree, shared section, archived tree, filter
pruning with dimmed ancestors, subagents shown under a node, archive confirmation open, multi
organization, mobile viewport, keyboard focus ring on a row. ConversationTimeline.stories.tsx:
relayed row (parent, child, hop 3, missing title, unknown sender), queued relayed preview.
SendChatMessageTool.stories.tsx and ListChatTreeTool.stories.tsx: started, queued,
interrupting with downgrade, error, running; tree with parent and children, root without parent,
empty children, error. Tool.stories.tsx showcase items.

Open questions

  1. Root display: title verbatim with a house icon (D3) versus relabeling Root as "Home" or the
    user's name. Verbatim chosen for consistency with the chat header.
  2. Subagent visibility: per-node lazy toggle (D5) is bounded but cannot show counts; accept, or ask
    the backend for subagent_count on tree rows in a later PR.
  3. Inline type-to-filter box in the tree header: not included; collectMatchingChatIDs makes it a
    small follow-up. Include now?
  4. Archive confirmation only when named children exist (D7), keeping today's no-confirmation
    behaviour for leaf chats. Confirm.
  5. groupBy hidden from the filter popover while the tree is on (D6). Confirm.
  6. "New chat here" through the composer with router state (D7) rather than creating an empty chat
    (not possible: POST /chats requires content). Confirm.
  7. aria-current="page" only on treeitems, dropping aria-selected from the overview's list to
    avoid double announcement (REVIEW-plan Implement initial API surface for creating workspace #23). Confirm or require both.
  8. Two backend gaps are reported rather than fixed here: tree rows carry no diff_status (no PR
    badges or PR filter in the tree) and tree tool errors arrive double-encoded (REVIEW-plan chore: Initial GHA workflow #1,
    chore: Add XState machines to model flows #16). Accept for this layer?

Generated by Coder Agents on behalf of @jscottmiller.

@jscottmiller jscottmiller added the experimental Changes that might not necessarily be merged, until its approved to proceed with. label Sep 20, 2026
@jscottmiller
jscottmiller force-pushed the scott/chat-tree/3-messaging branch from db5fcbd to 3e72a00 Compare September 20, 2026 20:09
Scott Miller added 6 commits September 20, 2026 20:11
Named child chats carry parent_chat_id but are not subagents, so the
actions menu, top bar sharing gate, and cost tree id must use kind
instead of inferring subagent from the parent link. Root chats hide
pin and archive actions.
Adds the organization chat tree endpoint client, a query factory keyed
outside the flat list family, and cache helpers that keep tree rows in
sync with watch events and the pin, archive, and rename mutations.
…storage

Pure modules for the tree sidebar: builds the hierarchy from tree
responses per organization, flattens visible rows for rendering and
keyboard navigation, implements the WAI-ARIA tree key pattern, and
persists expansion and subagent visibility per node.
…eriment

With the chat-tree experiment on, the agents sidebar replaces the flat
list with an organization tree fed by the tree endpoint: WAI-ARIA tree
semantics with roving focus, persisted expansion, per node subagent
toggles, pinned and shared sections, unread filtering that keeps
ancestors visible, a New chat here action that routes through the
composer, and an archive confirmation that explains the cascade. The
experiment-off path is unchanged and issues no tree request.
…nd chat tree tool calls

User rows delivered by another chat's agent get a provenance header
linking to the sender with its relation and relay hop, a distinct
border, and no edit affordance; queued previews carry the same prefix.
Adds renderers, icons, and stories for the send_chat_message and
list_chat_tree tool calls.
@linear-code

linear-code Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

CODAGT-1103

CODAGT-1033

@github-actions github-actions Bot locked and limited conversation to collaborators Oct 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

experimental Changes that might not necessarily be merged, until its approved to proceed with.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant