fix(chat): make links in agent questions clickable#19197

merged1
main
t3/clickable-question-tool-links
opened26d agobyTtheo
View on GitHubTwo-way sync enabledPR last imported 19d ago

When an agent asks a question with a link in it (for example, "Authorize this device at https://..."), the link showed as plain text. You had to copy it by hand. Now the link is clickable.

The question text now uses the markdown renderers that chat already uses. On web and desktop that is ChatMarkdown. On mobile it is SelectableMarkdownText. So links open the same way they do in chat: on web and desktop, the preview panel or a new tab; on mobile, the PR screen or the browser. Inline code such as `RTJS-TQGS` also renders correctly now. The collapsed one-line header stays plain text, because it is the toggle button.

BeforeAfter
beforeafter

Verification:

  • New test: a URL in the question renders as a link. It fails without the fix.
  • Web dev server with a seeded pending question: clicking the link opened it in a new tab, and no option got selected.
  • Mobile: typecheck only. No simulator was available on the host.

Related: #11132. This overlaps #18460, which also renders the options and the collapsed preview as markdown. This PR covers only the question text, but it includes mobile.

Reviewed with sol-loop: 1 round with GPT-6.1-Sol on high.

Created with Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

Checks

26 successful · 10 skipped
All checks passed
449a824

Added 1 commit

  • fix(chat): make links in agent questions clickable449a824
Synced from GitHub

Approvability

Verdict: Approved at 449a824

Macroscope's review found this PR approvable — This is a focused UI bug fix that reuses the existing web and mobile markdown/link renderers, with targeted test coverage and no changes to defaults, schemas, infrastructure, or static-analysis configuration. Its runtime impact is limited to rendering links and markdown in pending agent questions.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
CodexLive turn messages220 (0.0%)8✅
ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
ClaudeLive turn messages220 (0.0%)8✅

Baseline: 3feae3a · PR result: 449a824 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Synced from GitHub

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 9c17b257-334c-4266-9310-e5cec9c6855f
📥 Commits

Reviewing files that changed from the base of the PR and between 3feae3a94077317e78b7fd4591454ed68f9d4fd2 and 449a824586d546d2b91c3c8112fc2ee5c02a563e.

📒 Files selected for processing: 6
  • apps/mobile/src/features/threads/PendingUserInputCard.tsx
  • apps/web/src/components/chat/ChatComposer.tsx
  • apps/web/src/components/chat/ComposerPendingUserInputPanel.navigation.test.tsx
  • apps/web/src/components/chat/ComposerPendingUserInputPanel.permissions.test.tsx
  • apps/web/src/components/chat/ComposerPendingUserInputPanel.test.tsx
  • apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx

Included review availability: This review used your included allowance. 8 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.

📝 Walkthrough

Pending-user-input questions now render as Markdown on web and mobile. The web panel receives working-directory and scoped-thread context through both composer layouts and passes them to ChatMarkdown. The mobile card renders question Markdown and routes tapped links through useOpenPullRequest.

Changes: Pending question Markdown

Layer / File(s)Summary
Web question rendering and context
apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx, apps/web/src/components/chat/ChatComposer.tsx, apps/web/src/components/chat/ComposerPendingUserInputPanel*.test.tsx
The composer passes working-directory and thread context to the panel. The panel renders the active question with ChatMarkdown. Tests supply the required context and check URL link rendering.
Mobile question rendering
apps/mobile/src/features/threads/PendingUserInputCard.tsx
The card renders question prompts with selectable Markdown styling and routes tapped links through useOpenPullRequest.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to 449a8

No actionable merge-blocking risk was identified in the changed question-link behavior.

Pre-merge checks: Passed 4
Passed Passed checks: 4 passed
Check nameStatusExplanation
Title checkPassedThe title clearly and concisely describes the primary change: making links in agent questions clickable.
Description checkPassedThe description explains the problem, implementation, scope, related issues, focused verification, UI evidence, and mobile testing limitation. It is sufficiently complete despite not using the templat…
Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.