Skip to content

[Bug]: Paired-runtime Markdown review notes fail because mirrored tab IDs are not normalized #16225

Closed

Description

@Fartown

Operating system

macOS

Orca version

v1.4.188

Details

Short summary

Sending a Markdown review note to a live agent terminal on a paired runtime fails with:

The selected terminal is no longer available.

The note is saved, the paired runtime is reachable, and the selected terminal remains connected and writable. Delivery fails because the renderer-side mirrored tab ID (web-terminal-...) is compared directly with the host/native tab ID returned by terminal.list.

Steps to reproduce

  1. Pair a second Orca runtime.
  2. Open a Git repository/worktree hosted by that paired runtime.
  3. Start an agent terminal in the remote worktree.
  4. Open a Markdown file in the main editor and add a review note.
  5. Choose Send notes to an agent and select the live remote agent.
  6. Observe the error toast.

Expected behavior

The review note is delivered to the selected live agent terminal.

Actual behavior

Orca reports The selected terminal is no longer available. even though the selected terminal is still present, connected, and writable. The note remains saved and is not marked as delivered.

Confirmed cause on current main

The note target keeps the renderer tab ID. For paired-runtime mirrored surfaces, that ID is prefixed with web-terminal-.

findActiveRuntimeTerminal() in src/renderer/src/lib/active-agent-note-target.ts currently matches the runtime inventory with:

terminal.tabId === noteTarget.tabId && terminal.leafId === noteTarget.leafId

However, terminal.list on the paired runtime returns the host/native tab ID without the web-terminal- prefix. The strict comparison therefore returns no active terminal and maps to the user-visible no-active-terminal toast.

src/shared/terminal-surface-id.ts already provides toHostSessionTabId() for this conversion, and other paired-runtime terminal paths use it, but this note-delivery lookup does not.

Suggested fix

Normalize the renderer tab ID before comparing it with runtime inventory:

const hostTabId = toHostSessionTabId(noteTarget.tabId)

terminal.tabId === hostTabId && terminal.leafId === noteTarget.leafId

Please also add a regression test where the explicit note target uses web-terminal-tab-1, while terminal.list returns tab-1 with the same leaf ID, and assert that the live terminal is selected.

Environment

  • macOS client with a paired macOS runtime
  • Orca 1.4.188 on both sides
  • Still present on official main at 95633a78834ce6182a503a079aeafe7e15feba8b (checked 2026-08-24)

Related issue

#11191 shows the same toast after a host runtime restart leaves stale terminal handles. This is a different failure path: there was no host restart, the current terminal inventory was healthy, and the lookup failed deterministically because the renderer and host tab IDs use different namespaces.

No screenshot is attached because the original UI capture contains private local workspace names and paths.

Activity

  1. added theissue type on Aug 24, 2026
  2. added
    bug
    on Aug 24, 2026
  3. added
    os:macos
    on Aug 24, 2026
  4. moltar commented on Aug 31, 2026

    @moltar

    Still present on v1.4.193. It also hits a headless orca serve runtime, not only a paired desktop.

    My setup is a macOS desktop client on v1.4.193 and a remote runtime on v1.4.190 that runs orca serve on an EC2 host. Notes added on a diff or on a file never reach an agent that runs in a remote worktree. Every send fails, so the feature is unusable against that runtime.

    I read the same cause out of the shipped 1.4.193 bundle. findActiveRuntimeTerminal still compares the renderer tab id against the tab id that terminal.list publishes:

    terminals.find((terminal) => terminal.tabId === noteTarget.tabId && terminal.leafId === noteTarget.leafId) ?? null

    Here are the two ids from my machine, with the workspace paths removed:

    Source Tab id Leaf id
    terminal.list on the remote runtime 4a9c2e77-... 1faeda41-...
    Desktop pane key in orca-data.json, under acknowledgedAgentsByPaneKey web-terminal-4a9c2e77-... 1faeda41-...

    The leaf ids agree. Only the tab id carries the web-terminal- prefix, so the lookup finds nothing and the status maps to no-active-terminal.

    Two causes I ruled out, in case they come up in triage:

    #16231 carries the fix and has waited a week with no review. Can someone pick it up?

  5. nwparker commented on Oct 5, 2026

    @nwparker
    Contributor

    Closing as resolved on current main. The note-delivery lookup now converts the mirrored renderer tab ID to its host tab ID before matching the leaf, so web-terminal-tab-9 correctly finds host tab-9. The existing positive delivery regression for this exact namespace mismatch passes.

    Verified in the current lookup and its delivery regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggitos:macos

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions