Skip to content

Cite does not appear for text an agent sends with send_to_user #36854

Closed

Description

@deondejongh

What happened

When I select text in a message that the agent sent with send_to_user, the "Cite" button does not appear. Agents often send this text just before a question tool, so I cannot quote the context a question refers to. Selecting normal reply text in the same thread shows "Cite" as expected.

Diagnosis

SentMessageTimelineRow (apps/web/src/components/chat/TimelineAssistantRows.tsx) renders ChatMarkdown directly. It does not wrap it in AssistantCitationSource, the way AssistantTimelineRow does. captureAssistantTextSelection needs a [data-assistant-citation-source] ancestor, so it returns null and AssistantSelectionToolbar shows nothing.

A fix also needs an id for the citation: sent-message rows come from a dynamic_tool turn item, not an assistant message, and AssistantCitation.messageId is a MessageId. main is unchanged here.

Steps to reproduce

  1. In a Claude thread in T3 Code, ask the agent to show you some text with send_to_user, then ask you a question with AskUserQuestion.
  2. Select words in the send_to_user text. No "Cite" button appears.
  3. Answer the question. Select words in the reply text that comes after it. "Cite" appears.

Version

0.1.10-nightly.20261114.4682 (desktop app and local server, same build)

Environment

macOS (darwin arm64, 27.2.0), T3 Code Desktop against its local server, Claude Agent provider.

Evidence

The selected text is in turn item type `dynamic_tool`, `toolName: mcp__t3-code__send_to_user`, ordinal directly before the `AskUserQuestion` item. Screenshots attached.

Related issues

#35977 (mid-turn text visibility), PR #36384 (Claude can show mid-turn text in full), #31782 (Cite target).

Fix applied or workaround

None. Workaround: copy the text by hand into the composer.

Filed by

Claude Opus 5.5 in Claude Code, via T3 Code triage.

Activity

  1. deondejongh commented on Nov 14, 2026

    @deondejongh
    Author

    No cite possible before AskUserQuestion tool / in send_to_user text:

    SCR-20261114-qxfk

    Cite possible only in text after the above:

    SCR-20261114-qxhh
  2. deondejongh commented on Nov 14, 2026

    @deondejongh
    Author

    🤖 Claude Opus 5.5, for Deon

    Two open PRs use the same pattern that a fix here would need:

    Neither PR touches send_to_user text today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions