Make links clickable on Pax's full screen and show a `watch live` link in the status row

Closed
AD
11d ago
+394-93

Stacked on https://github.com/pydantic/pydantic-ai/pull/14564.

While computer use is on in a sandbox, Pax's status row now shows watch live ↗, and clicking it opens the desktop viewer in the browser. Before this, the only link was on a computer row in the transcript, and it could not be clicked on the full screen.

Why links did not click

The full screen paints through termflow's ScreenBuffer, which drops OSC 8 hyperlinks. A click opened a URL only if its text was visible in the transcript, so a Rich link on short text such as watch live ↗ did nothing.

What changed

  • Clickable painted links, pinned rows only. paint_row in ui/prompt/prompt_selection.py paints the rows the shell pins below the transcript (the footer). After it paints a row, it records which cells each http, https or file: OSC 8 link covers, using termflow's visible_length so wide characters line up. On a click, PromptSurface._url_at checks those cells first, then falls back to the old visible-URL scan of the transcript. Transcript rows record no links, so a model's [label](url) whose target is hidden never opens on one click.
  • StatusLink for status segments. A segment may now return StatusLink(text=, url=), imported from ui/rendering/status.py. The shell adds ↗ and strips control characters from the text and the URL. LivePrompt._footer writes it as an OSC 8 link, and closes the link if truncation cuts it. So it works in both modes: on the full screen by a click, and inline with the terminal's own Cmd+click.
  • The sandbox plugin. It adds a second segment, so the row reads fake sandbox | watch live ↗. It starts the viewer when computer use turns on, after /sandbox, at session start, and when the conversation changes. The status link and the computer row link point at the viewer's private 0600 file:// redirect page, one per sandbox, made when the viewer starts for it and removed at session end, so the viewer's token never reaches $BROWSER or xdg-open as an argument. The segment itself never starts the server or does IO, because it is read every frame. (computer-use) is left off while the link shows.
  • Docs. PLUGINS.md, docs/reference.md and FILE_MAP.md.

Checks

  • Tests: test_prompt_surface, test_live_prompt, test_status, test_computer_use and test_sandbox pass. Every changed source line is covered.
  • tmux check: /computer-use then /sandbox e2b on a real E2B sandbox, with BROWSER pointed at a script that logs URLs, so no browser opened.
    • Inline, the status row was written as an OSC 8 link to the file:// page; no OSC 8 link in the output carried token=.
    • On the full screen (after a resize), a scripted SGR click on watch live ↗ logged the same file:// page, as did /computer-use view. The page was mode 0600, its target answered 200, and it was gone after /exit. The sandbox was deleted.

Checklist

  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
  • PR title is fit for the release changelog.

Summary by cubic

Makes hyperlinks clickable on Pax's full screen and adds a watch live ↗ link to the status row while computer use is on. Previously OSC 8 hyperlinks were dropped when painting to the full screen, so clicks only opened URLs whose full text appeared in the transcript, and computer use was linked only from computer rows.

  • Records which cells the footer's http(s) and file: hyperlinks cover, so a click opens the link under the cursor; a transcript [label](url) link whose target is hidden does not open, and bare visible URLs still open on click. A cut at the row's edge closes an opened link so nothing after the footer gets linked.
  • Status segments can now return a StatusLink(text, url), painted as an OSC 8 hyperlink with ↗; other painters degrade to simple text.
  • The sandbox plugin shows watch live ↗ in the status row once the desktop viewer runs, starting the viewer when computer use turns on, at session start, on conversation change, and after /sandbox, without starting it from the frequently-read painter. Links point at one 0600 file:// page per sandbox, so the viewer's token never reaches the browser's command line.