Open Codex thread links inside the TUI (#62332)

## Why

Conversation search results can point users to saved transcripts. Users
need to be able to follow those links without leaving their terminal session.

## What changed

- Make Markdown links such as `[Review notes](codex://threads/<id>)`
  open the linked conversation from chat and transcript views. In the
  resume picker, follow the link to another transcript preview.
- Resolve nested agent links through their owning session and select the
  requested agent. Show archived conversations in read-only mode and
  let users explicitly reopen them.
- Include the Markdown link format in thread search results, including
  archived results.

## Testing

Add coverage for thread link parsing and activation, nested agent
navigation, archived thread reopening, and mouse capture during
transcript preview transitions.

GitOrigin-RevId: 40a39c43acf643b97e066ba663aefcf9cda0bc81
This commit is contained in:
Benjamin Carlsson
2026-11-18 18:28:58 +00:00
committed by copyberry
parent c39f047d24
commit 0a82fdf49d
27 changed files with 824 additions and 47 deletions
@@ -374,9 +374,16 @@ fn shift_click_preserves_selection_units_and_allows_dragging() {
#[test]
fn ordinary_click_opens_bare_and_markdown_links_on_release() {
for markdown in [
"https://example.com/docs",
"[docs](https://example.com/docs)",
for (markdown, destination) in [
("https://example.com/docs", "https://example.com/docs"),
(
"[docs](https://example.com/docs)",
"https://example.com/docs",
),
(
"[other thread](codex://threads/019e60fc-0518-7c21-9596-980fe97225ba)",
"codex://threads/019e60fc-0518-7c21-9596-980fe97225ba",
),
] {
for width in [12, 60] {
let (mut view, cells) = transcript(markdown, width);
@@ -405,7 +412,7 @@ fn ordinary_click_opens_bare_and_markdown_links_on_release() {
view.selected_text(&cells),
view.is_following()
),
("https://example.com/docs", None, true)
(destination, None, true)
);
assert!(view.handle_mouse(up, &cells).is_none());
}