fix(chat): make links in agent questions clickable#19197
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.
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
Added 1 commit
- fix(chat): make links in agent questions clickable449a824
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.
Thread transfer impact
✅ Thread transfer remains within every enforced ceiling.
| Provider | Metric | Main baseline | This PR | Impact | PR ceiling | |
|---|---|---|---|---|---|---|
| Codex | Total thread wire | 5.0 KiB | 5.0 KiB | 0 B (0.0%) | 6.8 KiB | ✅ |
| Codex | Thread snapshot wire | 3.8 KiB | 3.8 KiB | 0 B (0.0%) | 4.9 KiB | ✅ |
| Codex | Live turn WebSocket wire | 1.2 KiB | 1.2 KiB | 0 B (0.0%) | 2.0 KiB | ✅ |
| Codex | Live turn WebSocket decoded | 20.9 KiB | 20.9 KiB | 0 B (0.0%) | 29.3 KiB | ✅ |
| Codex | Live turn messages | 2 | 2 | 0 (0.0%) | 8 | ✅ |
| Claude | Total thread wire | 5.0 KiB | 5.0 KiB | 0 B (0.0%) | 6.8 KiB | ✅ |
| Claude | Thread snapshot wire | 3.8 KiB | 3.8 KiB | 0 B (0.0%) | 4.9 KiB | ✅ |
| Claude | Live turn WebSocket wire | 1.2 KiB | 1.2 KiB | 0 B (0.0%) | 2.0 KiB | ✅ |
| Claude | Live turn WebSocket decoded | 21.2 KiB | 21.2 KiB | 0 B (0.0%) | 29.3 KiB | ✅ |
| Claude | Live turn messages | 2 | 2 | 0 (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.
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.tsxapps/web/src/components/chat/ChatComposer.tsxapps/web/src/components/chat/ComposerPendingUserInputPanel.navigation.test.tsxapps/web/src/components/chat/ComposerPendingUserInputPanel.permissions.test.tsxapps/web/src/components/chat/ComposerPendingUserInputPanel.test.tsxapps/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 throughuseOpenPullRequest.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.tsxThe 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.tsxThe 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 name Status Explanation Title check Passed The title clearly and concisely describes the primary change: making links in agent questions clickable. Description check Passed The 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 check Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Passed Check 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.