feat: render rich session links in Chat and TUI

Author: harshitsinghbhandariCreated Aug 28, 2026Updated Sep 29, 2026
Labelsenhancementcomp/desktop

This was generated by AI during triage.

Feature

Allow any AO participant—not only an orchestrator—to reference another session using rich, clickable session links in Chat and the in-app TUI.

Example canonical target:

ao://sessions/agent-orchestrator/agent-orchestrator-255

An agent or user may include that target in a response. AO should render or detect it as a session reference and navigate only after the user clicks it.

User value

Workers frequently hand off investigation, implementation, review, or follow-up work to other sessions. Today the user must locate the target manually in the sidebar. A session reference should show useful identity/status and open the correct session directly.

Scope

Chat

  • Recognize allowlisted session URLs in messages from users, workers, orchestrators, and automation; do not role-gate the feature.
  • Support Markdown links and raw canonical URLs.
  • Render a rich session chip/link when target metadata is available, with a safe plain-link fallback.
  • Display the current session name, role/harness, and useful status without making the display name part of identity.

In-app TUI

  • Register a terminal link provider for canonical ao://sessions/... text and supported OSC 8 links.
  • Make activation explicit, using the platform-appropriate modifier/click behavior where needed to avoid interfering with terminal selection.
  • Intercept the URL inside AO; never pass it to the shell or an external browser.

Shared behavior

  • Use one strict parser/resolver/navigation path across Chat and TUI.
  • Resolve by stable project/session IDs so renaming does not break old messages.
  • Open terminated sessions in retained history/read-only mode when available.
  • Show an actionable error for missing, inaccessible, malformed, or unsupported targets.
  • Do not navigate automatically while content streams or merely because an agent emitted a URL.

Security boundary

  • This feature is navigation-only.
  • An agent must not force a route change or encode actions such as send, spawn, kill, merge, or shell execution.
  • The Markdown sanitizer and terminal detector must allow only the canonical AO route shape and reject lookalike/malformed schemes.
  • Link labels are untrusted presentation; resolved session metadata supplies authoritative identity.

Acceptance criteria

  • The same canonical session URL works in Chat and the in-app TUI.
  • Messages from every supported origin/role receive identical link behavior.
  • Clicking opens the exact project/session in the current AO app.
  • Rendering never causes automatic navigation.
  • Renaming the target changes its displayed metadata without breaking the stored link.
  • Missing and terminated-session behavior is explicit and tested.
  • TUI parsing handles line wrapping and adjacent punctuation without consuming unrelated terminal text.
  • Tests cover Chat Markdown/raw URLs, sanitizer behavior, TUI raw/OSC 8 detection, modifier activation, renamed/terminated/missing targets, and malicious URL variants.

Product questions

  • Should the first UI be a compact inline chip or a conventional styled link with a hover preview?
  • Should a click always open Chat, or restore the target's last active inspector surface?
  • Should generated messages expose a structured session-reference entity in addition to parsing canonical URLs?

Related work

  • #4602 defines system-level ao:// registration and the shared canonical session URL contract.

Source: Untrivial-ai/agent-orchestrator