Skip to content

fix(runtime): recognize hand-typed native Claude at its startup dialogs - #33826

Merged
nwparker merged 9 commits into
mainfrom
nwparker/agint-shell-typed-agent
Oct 26, 2026
Merged

nwparker merged 9 commits into
mainfrom
nwparker/agint-shell-typed-agent

Conversation

@nwparker

@nwparker nwparker commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​69 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​65
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​123 $\color{#cf222e}{\Huge{\mathbf{−}}}$​6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​117

ELI5

If you typed claude into an Orca shell tab yourself, Orca didn't know Claude was running there until Claude changed the tab title. Claude doesn't change the title while its first "Do you trust this folder?" question is on screen, so orca terminal show reported agentWait: none while Claude was stuck waiting for an answer. Now, when Orca checks a pane that has no agent title and that nobody has identified, it asks the OS which program is running in it.

Root cause

Two gaps on the same path. Neither one is about parsing the typed command line: cd x && ANTHROPIC_API_KEY=… claude, env VAR=… claude, and plain claude all failed the same way on main.

  1. Nothing asks for identity before the first title. The main runtime knows a pane's agent from launchAgent ?? foregroundAgent ?? launchCommandAgent (runtime-identity-state.ts getPaneAgentForTuiIdle). For a hand-typed agent only foregroundAgent can apply. It is refreshed only on OSC title status transitions and on inventory refreshes (terminal-title-observation.ts). Claude emits no title at its trust dialog: the tab keeps the shell's cwd title. So the pane stayed unidentified, and the Claude-only rendered-screen dialog check (terminal-wait-permission.ts readTerminalInteractiveWaitEvidence) never ran.
  2. Native Claude's process name is its version. The native installer links ~/.local/bin/claude -> ~/.local/share/claude/versions/2.1.310, so node-pty / the daemon report the foreground as 2.1.310. The daemon maps it to claude only through an async argv scan whose result is cached for 1s (foreground-process-tracker.ts). Orca already handles this elsewhere with confirmForegroundProcess (terminal-pane-mail-routing.ts: "macOS Claude p_comm can be 2.1.258").

What changed

  • OrcaRuntimeWithTitlelessPaneAgentIdentity (new layer, terminal/wait/titleless-pane-agent-identity.ts): before the interactive-wait evidence read, an untitled pane with no launch, foreground, or command owner is identified from its foreground process. The cheap ownership check runs first; only then is the screen projected, and the read happens only when its live screen (synchronous headless grid, else the tail) already shows a blocked dialog. Plain shells, editors, and owned or titled panes keep the existing synchronous path, with no added round-trip and hook probes still shared in the same tick. If the read times out (2s, the existing probe bound), the answer is undefined (unknown), never none. A disconnected or exited pane, or an unavailable read, answers null, so the existing output-tail path still decides.
  • RuntimePtyForegroundAgent.identifyUnowned: reads the foreground. Only an exact semver name (native Claude's versions/<semver> binary) gets one confirmForegroundProcess scan. It is skipped on win32, where native Claude is claude.exe, is recognized by name, and confirm forces a full scan. Only a scan that recognizes an agent is cached per pane, and only while that same name stays in the foreground. "Not an agent", errors, and unavailable results are never cached, so the next dialog rescans. Background refresh() is unchanged from main: it never consults the cache or scans. The cache is cleared on PTY teardown. The identity answers only the current interactive-wait query and is not stored as the pane's foregroundAgent: a dialog declined with Ctrl-C before Claude sets a title fires no title transition, so a stored identity would keep labelling the shell as Claude. Concurrent queries share one in-flight read and scan.

This reads the process table, not the typed text, so it works the same in bash, zsh, fish, PowerShell, and cmd.

Verification

Real dev Orca (background launch, isolated ORCA_DEV_USER_DATA_PATH, CLAUDE_CONFIG_DIR, CODEX_HOME, fake API keys only), Claude 2.1.310 native, orca terminal send into plain shell tabs, then orca terminal show:

typed command main this PR
claude agentWait: none agent-trust-workspace (via prompt-text)
ANTHROPIC_API_KEY=sk-ant-fake claude none agent-trust-workspace
cd /tmp && cd proj && ANTHROPIC_API_KEY=… FOO='a b' claude none agent-trust-workspace
env ANTHROPIC_API_KEY=… claude none agent-trust-workspace
idle shell / vim none none
OPENAI_API_KEY=… codex (trust dialog) — agent-trust-workspace
orca terminal create --command claude (control) agent-trust-workspace unchanged
  • Regression test claude-dialog-interactive-wait.test.ts: a hand-typed pane whose foreground is 2.1.310 and confirms as claude reports the real trust-dialog fixture. It fails on main with either half of the fix reverted.
  • pnpm tc, and the interactive-wait, worker-wait, dsb, and trust-transcript suites (70 tests). check:code-quality:changed passes.

Other agents

Codex, OpenCode, and Gemini report their own names as the foreground process, and their dialogs are judged from the output tail, which doesn't need pane identity. They didn't share the gap (Codex and Gemini trust dialogs were detected in the same run).

Risk / trade-offs

  • showTerminal → getTerminalInteractiveWait is used by terminal show, worker list/fleet status, orchestration, federation, launch-intent resolution, and remote transport. Added cost arises only for an unowned, untitled pane whose screen shows a blocked dialog: one foreground read. A process scan (about 0.4–1.3s on a host with 2.6k processes) runs only for a version-named foreground, at most once per pane per foreground name.
  • Under heavy load the first query can hit the 2s bound and report unknown (not evaluated). The next query answers.
  • SSH: the SSH provider has no confirmForegroundProcess, so a native Claude hand-typed on a remote host is still identified only through the relay's own foreground reporting. Not a regression.
  • Tests cover: the dialog is detected and a later background refresh leaves foregroundAgent unchanged (no rescan); a background refresh never scans; a non-version name never scans; a hung foreground read answers undefined; once the shell is back in the foreground the pane is not Claude-owned; a plain shell is never foreground-read.
  • The sidebar badge for trust-dialog panes is tracked separately.

A shell-typed claude emits no title at the trust dialog, so nothing asked
which process owned the pane, and native Claude's process name is its
version (2.1.310). agentWait now identifies a title-less, unowned pane
from its foreground process, confirming an unfamiliar name with one process
scan whose verdict is kept while that name stays in the foreground.
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f0b2fa4b-1b40-4372-bcd4-d58cf5c2a485
Commits

Reviewing files that changed from the base of the PR and between f9c3884 and fd11c14.

Files selected for processing: 6
  • src/main/runtime/claude-dialog-interactive-wait.test.ts
  • src/main/runtime/runtime-pty-foreground-agent.ts
  • src/main/runtime/terminal/input/terminal-agent-prompt-resubmit.ts
  • src/main/runtime/terminal/output/terminal-title-observation.ts
  • src/main/runtime/terminal/wait/terminal-wait-permission.ts
  • src/main/runtime/terminal/wait/titleless-pane-agent-identity.ts
Walkthrough

The change adds confirmation for version-named foreground processes and caches answered scans by PTY and foreground name. PTY cleanup clears delayed snapshots and cached confirmations. When a terminal has no title and shows blocked dialog-shaped output, a new runtime subclass checks for an unowned foreground agent before returning wait evidence. The held-agent prompt runtime uses this subclass. Tests cover native-Claude trust-dialog detection, scan reuse, skipped scans, timeout behavior, and plain-shell behavior.

Priority: Normal

Merge Risk: Moderate · up to f9c38

Foreground-read failures can produce an incorrect wait verdict, while stale text can delay wait checks. The new test also prevents a passing native Windows test run. Fix these before merging.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description clearly explains the problem, root cause, implementation, testing, scope, risks, and trade-offs. However, it omits the required linked issue and does not complete several required temp… Add an actual issue link under Fixes # or explain the applicable maintainer exception. Add Visual Proof with before/after evidence or N/A and a reason. Complete the Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, a…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: recognizing hand-typed native Claude at startup dialogs.
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.
Full details: Description check

Explanation

The description clearly explains the problem, root cause, implementation, testing, scope, risks, and trade-offs. However, it omits the required linked issue and does not complete several required template sections, including Visual Proof, Testing checkboxes, Review, Agent skill upstream boundary, Notes, and Checklist.

Resolution

Add an actual issue link under Fixes # or explain the applicable maintainer exception. Add Visual Proof with before/after evidence or N/A and a reason. Complete the Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections as applicable. Keep the existing technical explanation and verification details.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6276b89b-762d-4393-86fe-6030925a07cc
Commits

Reviewing files that changed from the base of the PR and between 56025f2 and c5b417e.

Files selected for processing: 5
  • src/main/runtime/claude-dialog-interactive-wait.test.ts
  • src/main/runtime/runtime-pty-foreground-agent.ts
  • src/main/runtime/terminal/input/terminal-agent-prompt-resubmit.ts
  • src/main/runtime/terminal/output/terminal-title-observation.ts
  • src/main/runtime/terminal/wait/titleless-pane-agent-identity.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

Comment on lines +164 to +168
agent = recognizeAgentProcess(await this.confirm(result.controller, ptyId))?.agent ?? null
if (result.controller !== this.deps.getController()) {
return false
}
this.confirmedByPtyId.set(ptyId, { foregroundName, agent })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major · Functional Correctness · Quick win

Do not cache a failed foreground scan.

If confirmForegroundProcess rejects, confirm returns null. Line 168 then caches null for the foreground name. Later checks reuse that result, so a native Claude startup dialog remains unidentified even after the scanner recovers. Distinguish a failed scan from a successful no-agent result, and retry failed scans.


Minor · Functional Correctness · Quick win

🔎 Supported by static analysis

Script executed:

sed -n '1,220p' src/main/runtime/runtime-pty-foreground-agent.ts
sed -n '1,100p' src/main/runtime/terminal/wait/titleless-pane-agent-identity.ts

Repository: stablyai/orca

Length of output: 8267


Script executed:

set -o pipefail
printf '%s\n' '--- identifyUnowned callers and foreground-agent integration ---'
rg -n -F --glob '*.ts' -e 'identifyUnowned(' -e 'ptyForegroundAgent' -e 'foregroundAgent' src/main/runtime src/main | head -240
printf '%s\n' '--- RuntimePtyController contract and implementations ---'
rg -n -F --glob '*.ts' -e 'interface RuntimePtyController' -e 'type RuntimePtyController' -e 'confirmForegroundProcess' -e 'getForegroundProcess' src/main | head -240
printf '%s\n' '--- relevant tests ---'
rg -n -F --glob '*.{ts,tsx}' -e 'identifyUnowned' -e 'confirmForegroundProcess' -e 'titleless' -e 'foreground process' tests src | head -240

Repository: stablyai/orca

Length of output: 41850


Script executed:

set -o pipefail
printf '%s\n' '--- titleless caller and wait flow ---'
nl -ba src/main/runtime/terminal/wait/titleless-pane-agent-identity.ts
nl -ba src/main/runtime/terminal/wait/terminal-wait-permission.ts | sed -n '250,330p'
printf '%s\n' '--- delayed confirmation tests ---'
nl -ba src/main/runtime/orca-runtime-tests/agent-status-and-waits-part-02.spec.ts | sed -n '285,545p'
printf '%s\n' '--- foreground provider contract and local implementation ---'
nl -ba src/main/providers/pty-provider-contract.ts | sed -n '175,210p'
nl -ba src/main/providers/local-pty-provider.ts | sed -n '160,205p'
nl -ba src/main/providers/local-pty-provider.ts | sed -n '500,540p'
printf '%s\n' '--- runtime controller delegation ---'
nl -ba src/main/ipc/pty/runtime/controller.ts | sed -n '55,85p'
nl -ba src/main/ipc/pty/runtime/operations.ts | sed -n '135,175p'

Repository: stablyai/orca

Length of output: 23803


Script executed:

set -o pipefail
printf '%s\n' '--- local confirmation helper ---'
rg -n -F --glob '*.ts' -e 'confirmLocalPtyForegroundProcess' -e 'getLocalPtyForegroundProcess' src/main
printf '%s\n' '--- titleless and interactive-wait tests ---'
rg -n -F --glob '*.spec.ts' --glob '*.test.ts' -e 'titleless' -e 'hand-typed' -e 'startup dialog' -e 'interactive wait' src/main/runtime tests | head -200
printf '%s\n' '--- changed-file history and tests ---'
git diff --unified=80 4c9a6a405501fa4d6dee6960a80ad2b33095bad0 c5b417e7850d28517105f39c015302c9906c6934 -- src/main/runtime/runtime-pty-foreground-agent.ts src/main/runtime/terminal/wait/titleless-pane-agent-identity.ts

Repository: stablyai/orca

Length of output: 12532


Script executed:

set -o pipefail
printf '%s\n' '--- local foreground inspection ---'
nl -ba src/main/providers/local-pty-foreground-inspection.ts | sed -n '80,275p'
printf '%s\n' '--- titleless regression test ---'
nl -ba src/main/runtime/claude-dialog-interactive-wait.test.ts | sed -n '1,220p'
printf '%s\n' '--- wait evidence consumer and agent status selection ---'
rg -n -F --glob '*.ts' -e 'readTerminalInteractiveWaitEvidence' -e 'getTerminalInteractiveWait' -e 'foregroundAgent' src/main/runtime/terminal/wait src/main/runtime | head -180

Repository: stablyai/orca

Length of output: 26958


Script executed:

set -o pipefail
printf '%s\n' '--- interactive wait and permission evidence ---'
nl -ba src/main/runtime/terminal/wait/terminal-interactive-wait.ts | sed -n '45,105p'
nl -ba src/main/runtime/terminal/wait/terminal-wait-permission.ts | sed -n '45,115p'
nl -ba src/main/runtime/terminal/wait/terminal-wait-permission.ts | sed -n '270,305p'
printf '%s\n' '--- title/status snapshot inputs ---'
rg -n -F --glob '*.ts' -e 'getTerminalWaitPermissionInputs' -e 'terminalAgent' -e 'agentType' src/main/runtime/terminal/wait src/main/runtime | head -120

Repository: stablyai/orca

Length of output: 22371


Recheck the foreground process before publishing confirmation.

load captures foregroundName before the asynchronous confirmation scan. The scan can observe a different process on the same PTY, but the post-await check compares only the controller. The code can therefore publish an agent for a process that is no longer foreground. The titleless wait path then uses that stale identity to decide whether to read Claude wait evidence.

Re-read the foreground process after confirmation and discard the result when it differs from foregroundName.

Suggested fix
--- "a/src/main/runtime/runtime-pty-foreground-agent.ts"
+++ "b/src/main/runtime/runtime-pty-foreground-agent.ts"
@@ -160,13 +160,22 @@
       const confirmed = this.confirmedByPtyId.get(ptyId)
       if (confirmed?.foregroundName === foregroundName) {
         agent = confirmed.agent
       } else if (confirmUnfamiliar) {
         agent = recognizeAgentProcess(await this.confirm(result.controller, ptyId))?.agent ?? null
         if (result.controller !== this.deps.getController()) {
           return false
         }
+        const current = await this.read(ptyId, 0)
+        if (
+          !current ||
+          current.controller !== this.deps.getController() ||
+          !current.available ||
+          current.process !== foregroundName
+        ) {
+          return false
+        }
         this.confirmedByPtyId.set(ptyId, { foregroundName, agent })
       }
     } else {
       this.confirmedByPtyId.delete(ptyId)
     }
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
agent = recognizeAgentProcess(await this.confirm(result.controller, ptyId))?.agent ?? null
if (result.controller !== this.deps.getController()) {
return false
}
this.confirmedByPtyId.set(ptyId, { foregroundName, agent })
agent = recognizeAgentProcess(await this.confirm(result.controller, ptyId))?.agent ?? null
if (result.controller !== this.deps.getController()) {
return false
}
const current = await this.read(ptyId, 0)
if (
!current ||
current.controller !== this.deps.getController() ||
!current.available ||
current.process !== foregroundName
) {
return false
}
this.confirmedByPtyId.set(ptyId, { foregroundName, agent })

nwparker and others added 2 commits October 26, 2026 03:36
…en a dialog is on screen

Review follow-ups: an untitled, unowned pane earns a foreground read only
when its live screen shows a blocked dialog, so plain shells answer without
a round-trip; the process scan runs only for a semver-shaped foreground name
(native Claude's versions/<semver> binary), never on win32, and only an
answered scan is cached.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fc8eae18-035c-42d0-ae3a-29f0b0cb48f6
Commits

Reviewing files that changed from the base of the PR and between c5b417e and f9c3884.

Files selected for processing: 3
  • src/main/runtime/claude-dialog-interactive-wait.test.ts
  • src/main/runtime/runtime-pty-foreground-agent.ts
  • src/main/runtime/terminal/wait/titleless-pane-agent-identity.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

})
await runtime.refreshPtyForegroundAgentFromController(TRANSCRIPT_PANE_PTY_ID)
expect(runtime['ptysById'].get(TRANSCRIPT_PANE_PTY_ID)?.foregroundAgent).toBe('claude')
expect(counts.scans).toBe(1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major · Functional Correctness · Quick win

Make the scan assertion platform-specific.

On win32, RuntimePtyForegroundAgent.load skips confirmation scans. This test still requires counts.scans to equal 1, so it fails on Windows. Skip this positive-scan case on Windows, or assert the Windows behavior separately.

return withTimeoutResult(
this.load(ptyId, 0, true),
TERMINAL_INTERACTIVE_WAIT_PROBE_TIMEOUT_MS
).then((result) => result.ok)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Treat an unavailable foreground read as unknown.

If getForegroundProcess rejects, read reports available: false and load returns false. The timeout wrapper still reports ok: true, so identifyUnowned sends the pane to the ordinary wait-evidence path instead of returning unknown. Preserve the read’s availability separately from load’s change result, and return false when the read was unavailable.

const identity =
terminal.titleStatus === null &&
detectTerminalWaitBlockedReason(
this.readLiveTerminalScreenLines(ptyId)?.join('\n') ?? terminal.waitText

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Stability & Availability · Quick win

🔎 Supported by static analysis

Script executed:

sed -n '1,110p' src/main/runtime/terminal/wait/titleless-pane-agent-identity.ts
rg -n 'readLiveTerminalScreenLines|readTerminalWaitEvidence|waitText' src/main/runtime/terminal/wait src/main/runtime/terminal/input/terminal-agent-prompt-resubmit.ts

Repository: stablyai/orca

Length of output: 3252


Script executed:

set -o pipefail
printf '%s\n' '--- parent and related declarations ---'
rg -n -F --glob '*.ts' \
  -e 'readTerminalInteractiveWaitEvidence' \
  -e 'identifyUnowned' \
  -e 'class OrcaRuntimeWithResolveAuthoritativeTerminalWaitPermission' \
  -e 'interface PtyForeground' \
  -e 'type PtyForeground' \
  src/main/runtime
printf '%s\n' '--- parent implementation block ---'
sed -n '1,260p' src/main/runtime/terminal/wait/terminal-wait-permission.ts
printf '%s\n' '--- foreground identity implementation candidates ---'
rg -n -F --glob '*.ts' -e 'identifyUnowned(' -e 'class' src/main/runtime/terminal src/main | head -160
printf '%s\n' '--- directly related tests ---'
rg -n -F --glob '*.{ts,tsx}' \
  -e 'titleless-pane-agent-identity' \
  -e 'identifyUnowned' \
  -e 'waitText' \
  tests src/main/runtime/terminal | head -240

Repository: stablyai/orca

Length of output: 36251


Script executed:

set -o pipefail
printf '%s\n' '--- foreground agent implementation ---'
sed -n '1,190p' src/main/runtime/runtime-pty-foreground-agent.ts
printf '%s\n' '--- interactive wait consumer ---'
sed -n '1,125p' src/main/runtime/terminal/wait/terminal-interactive-wait.ts
printf '%s\n' '--- foreground agent references and related timeout constants ---'
rg -n -F --glob '*.ts' \
  -e 'new RuntimePtyForegroundAgent' \
  -e 'PtyForegroundAgent' \
  -e 'foregroundProcess' \
  -e 'foreground.*timeout' \
  -e 'identifyUnowned' \
  src/main/runtime src/main | head -220

Repository: stablyai/orca

Length of output: 37460


Require a live screen before starting the foreground probe.

When readLiveTerminalScreenLines returns no screen, retained terminal.waitText can still trigger identifyUnowned. That method wraps the foreground scan in withTimeoutResult, and getTerminalInteractiveWait awaits the returned promise. A stale blocked string can therefore delay the response without current live-screen evidence.

Suggested fix
--- "a/src/main/runtime/terminal/wait/titleless-pane-agent-identity.ts"
+++ "b/src/main/runtime/terminal/wait/titleless-pane-agent-identity.ts"
@@ -12,12 +12,14 @@
   ): TerminalInteractiveWaitEvidence | Promise<TerminalInteractiveWaitEvidence | undefined> {
     const { terminal } = this.getTerminalWaitPermissionInputs(handle, ptyId)
     // Only dialog-shaped output earns a foreground read; plain shells and editors answer synchronously.
+    const liveScreen = this.readLiveTerminalScreenLines(ptyId)
     const identity =
       terminal.titleStatus === null &&
+      liveScreen !== undefined &&
       detectTerminalWaitBlockedReason(
-        this.readLiveTerminalScreenLines(ptyId)?.join('\n') ?? terminal.waitText
+        liveScreen.join('\n')
       ) !== null &&
       this.ptyForegroundAgent.identifyUnowned(ptyId)
     if (!identity) {
       return super.readTerminalInteractiveWaitEvidence(handle, ptyId)
     }

nwparker and others added 6 commits October 26, 2026 05:19
A hand-typed native Claude identified for an interactive-wait query was
stored as the pane's foregroundAgent. If the user declined the trust
dialog before Claude set a title, no title transition fired, so the shell
stayed labelled Claude until the next inventory refresh.

The identity now answers only the current query; the per-pty scan cache
(keyed by foreground name) keeps repeat queries cheap. Concurrent queries
share one in-flight identify, and the version-name match is anchored.
…or disconnected panes

- load() matches main again; only identify() consults the confirm-scan cache
- disconnected/unreadable panes answer null so the tail path still answers; only timeout is unknown
- check pane ownership before projecting the screen
- cache only recognized agents, so a not-an-agent verdict is rescanned

Co-Authored-By: Claude <[email protected]>
@nwparker
nwparker merged commit 6c815e8 into main Oct 26, 2026
39 checks passed
@nwparker
nwparker deleted the nwparker/agint-shell-typed-agent branch October 26, 2026 14:13
Kooooojun added a commit to Kooooojun/orca that referenced this pull request Nov 2, 2026
…aude

Native Claude's foreground process name is its version binary (2.1.316),
so the foreground refresh named no agent and the trust card never showed
when claude was typed into a shell. Identify the pane through the existing
identifyUnowned scan for this dialog only, without storing the identity
on the pty (stablyai#33826), so a declined dialog does not leave the shell
labelled Claude.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant