Skip to content

feat(orchestration): let a structured chat run orchestration as itself - #22568

Merged
brennanb2025 merged 24 commits into
mainfrom
brennanb2025/d3-cli-injection
Sep 28, 2026
Merged

brennanb2025 merged 24 commits into
mainfrom
brennanb2025/d3-cli-injection

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1142 $\color{#cf222e}{\Huge{\mathbf{−}}}$​167 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​975
Prod 34 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​426 $\color{#cf222e}{\Huge{\mathbf{−}}}$​139 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​287

ELI5

A native chat can now run Orca orchestration commands as itself. Orca already gives every native chat an id. This PR puts that id, and this app's own orca CLI, into the environment of every command the chat runs. So when a chat runs orca orchestration run-create, check or worker-start, it acts as that chat. Before, it either refused or, worse, guessed a nearby terminal and read that terminal's messages. Terminals are not changed at all.

What Changed

Before: a native (structured) Claude or Codex chat that ran orca orchestration ... had no identity of its own. The CLI either refused, or picked a sibling terminal pane in the same worktree and acted as it, which could consume that pane's messages (#21097).

After: the chat acts as session:<id>. It can create a run, start workers, and receive their worker_done. It never touches another pane's messages, and a flag that tries to act as someone else is refused before anything is sent. Verified live with real Claude and Codex chats (screenshots below).

Mechanism

  • One place builds a native chat's child environment (structuredSessionChildIdentityEnv, used by both the Claude and the Codex native launch). It now sets:
    • ORCA_AGENT_SESSION_ID: the Orca-minted session id, not the provider's, which rotates on /clear.
    • ORCA_CLI_COMMAND: this app's CLI launcher by absolute path, plus the same PATH prepend terminals get. The absolute path matters because Codex runs every command as zsh -lc, and a login profile can put a global orca ahead on PATH. When no launcher resolves, the key is left out rather than set to a bare orca, which on Linux is GNOME's screen reader.
    • ORCA_USER_DATA_PATH: pinned to this instance, so any current CLI talks to the Orca that minted the id.
    • ORCA_STRUCTURED_SESSION: kept next to the id, so a CLI that predates the id refuses instead of guessing a terminal.
  • The CLI uses the id as the caller. The shared caller resolver (resolveOrchestrationTerminalHandle) checks the id first. When it is present, the CLI sends it in the orchestration envelope and resolves no terminal. The host (refactor(orchestration): resolve every caller and target to one orchestration party, keyed by the Orca session id #22555) binds it. All 16 commands that name a caller get this from the one resolver.
  • A conflicting caller flag is refused at the CLI entry. Each orchestration command's spec declares whether its --from/--terminal names the caller or a target (identityFlagRoles). The CLI checks once, before any request, that a caller flag restates the session. Otherwise it refuses with "This command runs as agent session <id>, so --terminal <x> would act as a different caller. Drop --terminal … No request was sent." This also protects an older host reached over a pairing, which would honor the flag and ignore the id.
  • The id never leaks where it doesn't belong. It and the marker are stripped from every terminal's environment (local, daemon and SSH relay spawns), and from the SSH passthrough to a remote CLI.
  • Terminals are unchanged. Terminal env assembly, the Codex launch preflight, the packaged launchers and the Windows launcher are identical to main. Terminal agents keep acting as their terminal handle.
  • Supporting:
    • STRUCTURED_WORKER_HANDLE_PREFIX now lives in src/shared/structured-worker-handle.ts, so the CLI and main share one definition.
    • The session address prefix lives in a zero-import leaf, so the CLI entry spells session:<id> without loading the address codec.
    • A vitest setup file strips an inherited id and marker, so the suite behaves the same when run from inside a native chat.
    • The real-zsh login-shell test runs in the CI lane that installs zsh.

Why

Why bare orca works with no new instructions for agents: agents keep the same commands and skill text as terminal agents; only the address differs. A chat's bare orca resolves in one of three ways:

  1. Any current CLI, from any install, reads the injected id and dials the pinned instance, so it acts as the chat.
  2. A CLI older than this PR has no id support and refuses on the marker, which is safe.
  3. The absolute ORCA_CLI_COMMAND lets an agent that follows the existing skill reach this app's CLI even when a login shell reorders PATH.

Alternatives considered:

  • Re-running a command through the session's own CLI when a different Orca CLI was invoked. An earlier revision of this PR did this, and it was removed. It could not help the case it targeted: an older global CLI has no re-run code. For a current CLI it changes nothing, because rule 1 above already makes any current CLI act as the chat. It also kept producing bugs from comparing two separately derived paths: an AppImage's mount path vs its extracted copy, Windows short paths, and a second process per command.
  • Setting the absolute CLI path in every terminal too. Dropped. It changed which binary answers in plain terminals: running another Orca build's CLI from a terminal would silently run this app's instead. The chat fix doesn't need it.
  • Codex shell_environment_policy.set.PATH. Rejected. Codex only re-applies it when a command reuses its shell snapshot, and a login profile reorders PATH again otherwise.

Known limits, follow-ups:

  • If a user's Codex config sets shell_environment_policy.inherit = "core" or "none", Codex strips the id and the marker from commands. That is already true on main for the marker. Carrying the identity keys through Codex's per-thread shell_environment_policy.set as well as the process environment would survive that. Follow-up.
  • The CLI-entry caller-flag check duplicates the host's own caller fence for current hosts. Consolidating into the host is a follow-up once older paired hosts age out.
  • A native chat can no longer pass --from/--terminal naming another caller, including to drive a paired remote runtime as some other terminal. That is the point of the refusal. A chat acts only as itself.
  • On packaged Windows, ORCA_CLI_COMMAND is …\resources\bin\orca.exe, which contains a space when the Windows username does. Agents in the live QA referenced the variable ("$ORCA_CLI_COMMAND") rather than pasting its value, and bare orca also resolves through the PATH prepend. Not yet verified live on Windows.
  • Identity is per process: every helper a Codex session starts presents the session's id.
  • Identity by session id assumes one machine and one user. The host refuses a session claim that arrives across a host boundary.

Linked Issue

Supersedes #19648. Part of the structured-chat orchestration stack after #22555.

Visual Proof

Live on a dev build of this branch (macOS, M4 MacBook Air), real Claude Code and real Codex native chats.

Before (main): a native chat has no id, and orchestration refuses it as identity-less.

before-s0-claude-01.jpg
before-s1-claude-refusal.jpg

After: each chat's commands carry its own id, this app's CLI and the pinned instance (Claude, Codex).

final-f0-claude.jpg
final-f0-codex.jpg

After: a native Claude chat and a native Codex chat each coordinate a terminal worker to worker_done.

final-f2-claude-done.jpg
final-f2-codex-done.jpg

After: asked to check another terminal's inbox, the chat is refused before sending, and it reads the refusal correctly. That terminal's message is still there afterwards.

final-f3-refusal.jpg
final-f3-terminal-check.jpg

After: a plain terminal's environment is the same as on main (its handle, no session id, no ORCA_CLI_COMMAND).

final-f1-terminal-env.jpg

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Live QA (macOS dev build, real agents).

  • Identity: both chats carry the id, and Codex does through zsh -lc too. A chat's check never consumes a sibling terminal's pending message. --terminal <other handle> is refused, and both agents recovered by dropping the flag.
  • End to end: a native Claude chat and a native Codex chat each created a run as session:<id>, started a terminal worker and received its worker_done.
  • Unchanged paths: a Claude Code TUI in a terminal still acts as its terminal handle. A bare orca that reached an older global CLI refused safely and did not touch the live app.

Automated.

  • pnpm tc passes. All changed test files and the CLI, PTY and main CLI suites pass (282 files).
  • New tests cover id injection for native Claude and Codex, the PTY and SSH strips, the one caller rule across every verb, the entry refusal derived from specs, and the CLI's own address agreeing with the host's party resolver.
  • The real login-shell test runs under zsh in CI.

Not tested live: Windows, Linux (including AppImage) and packaged builds are covered by unit tests only.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Security: the id is only honored locally, and the host refuses cross-host claims.
  • Cross-platform: absolute launcher per platform (dev orca-dev/orca-dev.cmd, macOS resources/bin/orca, Windows orca.exe, Linux shim).
  • SSH: the id is stripped from the passthrough.
  • Mobile: unaffected.
  • Backward compatibility: older CLIs refuse on the marker. agentSessionId is an optional envelope field.
  • Performance: a few env reads at the CLI entry, and nothing added outside sessions.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@pullfrog pullfrog 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.

ℹ️ No critical issues — one minor correctness edge inline.

Reviewed changes

  • Session id injected into every structured child. structuredWorkerChildIdentityEnv becomes structuredSessionChildIdentityEnv, setting ORCA_AGENT_SESSION_ID plus the CLI PATH entry for chats and workers alike; both native providers (Claude resolver, Codex builder) build their child env here.
  • Terminal view carries the same id. ensureAgentSession passes the id in spawn env via withStructuredSessionTerminalViewEnv, deliberately not in the persisted launchConfig.agentEnv.
  • CLI acts as the session. The shared resolver returns undefined when the injected id names the caller and refuses a conflicting caller flag with consumer_fenced before any request; all 16 caller-naming verbs inherit the rule, with a per-verb and a 30-verb enumerated test.
  • Envelope and stripping. The id rides orchestrationCompatibilityEvidence.agentSessionId; SSH host-CLI passthrough, inherited PTY env (local/daemon/relay), and WSL are handled, and the shared structworker_ handle helpers move to src/shared.
  • Tests. Per-verb and enumerated CLI coverage plus env-propagation tests spanning native Claude/Codex (including a spawned real child), terminal view, WSL, PTY inheritance, and SSH.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

ℹ️ No new issues in this delta. The run-scoped caller-flag gap for gate-list/task-list is closed cleanly, with tests that fail against the previous code. The one open thread from the prior review — injectedSessionAddress() for a worker in terminal view — is untouched by these commits and remains open.

Reviewed changes

  • Added refuseConflictingSessionCaller to terminal-identity.ts. A session still validates the caller flag on a --run-scoped listing: it throws consumer_fenced before any RPC when --from names another actor, and returns undefined otherwise.
  • Routed gate-list --run and task-list --run through it. Both previously short-circuited to undefined when --run was present, so a conflicting --from on the run-scoped path was silently dropped instead of refused. They now match every other caller-naming verb.
  • Pinned the run-scoped rule. A per-command test asserts the flagless path sends no caller param, that another actor's handle is refused with consumer_fenced and zero RPCs, and that the session's own session:<id> spelling is accepted.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

Important

The new structured-session-cli-login-shell.test.ts hardcodes /bin/zsh, which the default Linux unit-test shards do not have installed, so it will fail the required Unit-tests check. Verified locally: 2 of its 3 cases exit with spawn /bin/zsh ENOENT.

Reviewed changes

  • Named this app's CLI by absolute path. prependOrcaCliDirToChildPath now returns the launcher, and structuredSessionChildIdentityEnv sets ORCA_CLI_COMMAND to it (dev orca-dev, packaged resources/bin/orca / orca.exe, packaged Linux shim) instead of the literal 'orca', falling back only when there is no app environment.
  • Added a real-login-shell test. structured-session-cli-login-shell.test.ts sets a temp HOME whose profile prepends a stand-in global orca, then asserts bare orca resolves to the global and "$ORCA_CLI_COMMAND" resolves to this app for zsh -lc and bash -lc.
  • Updated env expectations. Claude, Codex, and identity-env tests now expect the absolute dev launcher.

The ORCA_CLI_COMMAND value is intentionally kept to the bare-name union when sent on the wire (resolveCompatibilityCliCommand, schema in orchestration-params.ts:45,125), while the locally printed resume commands use the absolute path and are quoted by renderCommand — both correct. The prior review's open injectedSessionAddress() thread is untouched by this commit.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Split the login-shell suite by shell. The zsh arm moved to a new structured-session-cli-login-shell.live-shell.test.ts; structured-session-cli-login-shell.test.ts keeps only the bash arm, so it no longer spawns a shell the ordinary unit lane lacks.
  • Extracted the shared setup. structured-session-login-shell-test-harness.ts holds the temp HOME, the stand-in global orca stubs, and the structuredSessionChildIdentityEnv wiring, consumed by both suites.
  • Wired the zsh arm into the real-shell lane. pr.yml adds the new file to the shell-contracts job and unit-tests.yml adds it to the shard --exclude list, so the required Unit-tests check no longer runs it.
  • Taught the lane guard to see a program-field zsh. realZshUsage in config/scripts/pr-workflow-parallelism.test.mjs gained a program:\s*['"](?:\/(?:usr\/)?bin\/)?zsh['"] alternative, and the new file joined shellContractFiles — the mechanism that let the test escape the zsh-install lane.

Verified locally on the zsh-less runner: the lane guard passes (19/19), the bash arm passes (2/2), and the new live-shell file fails only when run directly outside the exclude.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@brennanb2025
brennanb2025 force-pushed the brennanb2025/d2-caller-resolver branch from 22f54f2 to 3ace023 Compare September 24, 2026 10:59
@brennanb2025
brennanb2025 force-pushed the brennanb2025/d3-cli-injection branch from 2d9dc67 to fef6854 Compare September 24, 2026 10:59
@brennanb2025
brennanb2025 force-pushed the brennanb2025/d2-caller-resolver branch from 3ace023 to f771efd Compare September 24, 2026 11:58
@brennanb2025
brennanb2025 force-pushed the brennanb2025/d3-cli-injection branch from fef6854 to 3af56b1 Compare September 24, 2026 11:58
@brennanb2025
brennanb2025 force-pushed the brennanb2025/d2-caller-resolver branch from f771efd to 6746bb5 Compare September 24, 2026 20:28

@pullfrog pullfrog 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.

ℹ️ No new issues in this delta. One low-impact edge raised by the prior review — injectedSessionAddress() returning session:<id> for a structured worker in terminal view — is unchanged by these commits, so this is informational rather than an approval.

Reviewed changes

  • Refusal moved to a spec-declared, single CLI-entry check. Every CommandSpec now carries identityFlagRoles, and main() refuses a session's caller flag naming another actor once, after flag validation; target flags (inbox --terminal, dispatch-show --from, worker-start --terminal) still pass through. namesInjectedSession compares plain strings so the check stays off the actor codec's module graph.
  • Session CLI handoff. A current CLI reached through a different install re-runs the command once through the launcher the session named (ORCA_CLI_COMMAND), bounded by ORCA_CLI_REEXEC, then exits with its status. The packaged macOS/Linux launchers, the Linux bare-orca shim/dispatcher, and the Windows launcher now export ORCA_CLI_SELF; a dev launcher exports none on purpose.
  • Absolute launcher in every local terminal. buildPtyHostEnv names this app's CLI by absolute path for all non-WSL terminals, not just structured sessions; resolvePackagedWindowsCompatibilityCommand now maps an absolute value to orca/orca-ide instead of throwing.
  • Omit rather than guess, and pin the instance. applyThisAppCli drops an inherited ORCA_CLI_COMMAND and omits it (with a warning) when no launcher resolves, rather than falling back to bare orca, and sets ORCA_USER_DATA_PATH beside the identity.

Verified locally: tc:cli is clean and the new/changed suites pass (166 passed, 4 skipped across session-cli-reexec, orchestration-session-caller-cli, index-orchestration, structured-session-child-identity-env, cli-self-export, windows-launcher-asset, linux-terminal-orca-cli-shim). The declared flag roles match each handler's actual use, and the new plain-string acceptance set matches the old normalizeOrchestrationActor-based one.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@brennanb2025
brennanb2025 force-pushed the brennanb2025/d2-caller-resolver branch from 6746bb5 to 8dac986 Compare September 24, 2026 22:10
@brennanb2025
brennanb2025 force-pushed the brennanb2025/d3-cli-injection branch from 0ef7f31 to 3f5f798 Compare September 24, 2026 22:11
@brennanb2025
brennanb2025 force-pushed the brennanb2025/d2-caller-resolver branch from 8dac986 to a77c7a4 Compare September 25, 2026 05:39
@brennanb2025
brennanb2025 force-pushed the brennanb2025/d3-cli-injection branch from 3f5f798 to 00f4525 Compare September 25, 2026 05:42
@brennanb2025
brennanb2025 force-pushed the brennanb2025/d2-caller-resolver branch from a77c7a4 to abe5c3d Compare September 25, 2026 07:36
@brennanb2025
brennanb2025 force-pushed the brennanb2025/d3-cli-injection branch 2 times, most recently from 9d02ccc to 52774a0 Compare September 25, 2026 19:43

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

Since prior pullfrog review 5309964149 (0ef7f31623):

  • Dropped the terminal-view session-id spawn. 52774a0337 deletes withStructuredSessionTerminalViewEnv, reverts ensureAgentSession to base, removes the WSL WSLENV id entry and the terminal-view PTY/daemon tests, and makes the inherited-stamp strip unconditional, since #22783 on the base removed the handoff that path served.
  • Moved injectedSessionAddress into shared. f8ab17a21b relocates it to src/shared/agent-session-caller-env.ts, backed by the import-free leaf src/shared/orca-session-address-prefix.ts; orca-session-address.ts re-exports the prefix and reuses the leaf STRUCTURED_WORKER_HANDLE_PREFIX.
  • Kept the entry check off the codec graph. f87111d528 compares the session's spellings as plain strings (id, session:<id>, own handle) so refuseConflictingSessionCallerFlags stays off the actor codec's module graph.
  • Added a CLI-vs-host address cross-check. orchestration-party-cli-address.test.ts asserts injectedSessionAddress lands on resolveOrcaSessionParty(...).address for a chat (with an inherited pane handle) and a registered worker.

This also retires the prior open worker-in-terminal-view thread: with no terminal view presenting as a session, injectedSessionAddress can no longer mis-name a worker. tc:cli/tc:node are clean and the touched suites pass.

ℹ️ The PR description still documents the removed terminal-view path

The body's ELI5, sections 1/4/5, and the ablation table still describe the id being injected into a terminal view's spawn env and carried into WSL via WSLENV. 52774a0337 removed that path, so the description now maps a change that is not in the diff.

Technical details
# Stale PR description after the terminal-view removal

## Affected sites
- PR body, ELI5 and "What Changed" §1/§4/§5 — describe `withStructuredSessionTerminalViewEnv` and the WSL `ORCA_AGENT_SESSION_ID/u` passthrough as active.
- PR body, "Ported from #19648" and the ablations table — list the terminal-view spawn and its ablation as live mechanisms.

## Required outcome
- The description should state that only a native structured child (Claude/Codex) carries the id; a terminal view now carries neither the id nor the marker.

## Open questions for the human
- None.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@brennanb2025
brennanb2025 force-pushed the brennanb2025/d3-cli-injection branch from 52774a0 to df8b939 Compare September 26, 2026 01:09
@brennanb2025
brennanb2025 changed the base branch from brennanb2025/d2-caller-resolver to main September 26, 2026 01:09
@brennanb2025
brennanb2025 force-pushed the brennanb2025/d3-cli-injection branch from df8b939 to 7a0b037 Compare September 26, 2026 01:11
@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 53875956-9866-4601-8426-ab811364b564

📥 Commits

Reviewing files that changed from the base of the PR and between a66627e7c2b7d52de06cc004249597fdb963e0ba and 97cfa1b280279b3e1736a4a8dda2504c71c276c7.

📒 Files selected for processing (11)
  • native/windows-cli-launcher/OrcaCliLauncher.cs
  • src/cli/session-cli-reexec.test.ts
  • src/cli/session-cli-reexec.ts
  • src/main/cli/cli-entry-path.ts
  • src/main/cli/windows-launcher-asset.test.ts
  • src/main/codex/codex-structured-child-environment.test.ts
  • src/main/codex/codex-structured-session-adapter.test.ts
  • src/main/runtime/structured-session-child-identity-env.test.ts
  • src/main/runtime/structured-session-child-identity-env.ts
  • src/main/ssh/ssh-remote-cli-host-passthrough.ts
  • src/shared/agent-session-caller-env.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.


📝 Walkthrough

Walkthrough

Structured-session children now receive session identity and app CLI settings. The executable CLI can hand off to a session launcher, and orchestration commands validate caller identity flags. PTY and SSH subprocess environments remove inherited session markers. New tests cover child environments, CLI handoff, orchestration identity, and Bash and zsh command resolution.

Priority: ➖ Normal

Merge Risk: 🟡 Moderate · up to 97cfa

Ordinary structured chats can attribute activity to a parent terminal or pane. Clear inherited identity before merging; the remaining test and CI-selection gaps also need owner attention.

Security Architecture Review

Security architecture risk: 🟡 Moderate · up to 97cfa

Structured chats can now run orchestration commands as themselves, with checks that reject conflicting caller names and nonlocal session claims. The remaining design risk is that a local process may be able to claim another active chat’s identity by changing its environment. That boundary needs confirmation before the risk can be treated as minimal.

Retained concerns

  • Medium · security · inferred: Making session-ID claims available to every structured chat expands use of a caller-binding path whose inspected host checks establish that a session is live, but not that the requesting process owns it. A local process able to set the CLI environment and name another live session may therefore be bound as that session, unless an additional transport control prevents it.
Security review details

Security Blast Radius

  • inferred — The unresolved claim-origin risk is bounded by access to the local runtime and knowledge of another live session ID; the inspected host rejects paired-client, SSH/WSL, remote-host, unknown, and non-live session claims. A successful claim would select that session’s orchestration caller, potentially affecting its messages or runs.

Security Findings and Attack Paths

  • inferred — A process that changes its injected session ID could submit that value through the CLI envelope. The inspected host resolver tests whether the named session has a live owner, not whether that owner is the submitting process. Transport-level origin binding was not established, so successful impersonation is a design risk rather than a verified exploit.

Trust Boundaries and Controls

  • observed — CLI caller-flag fencing and host-side declared-caller checks prevent a differing flag from overriding an injected session claim. They do not independently authenticate the claim’s origin.

Resilience and Maintainability Implications

  • observed — The one-hop re-execution marker is consumed before handoff selection, limiting repeated handoffs; startup failure returns control to the current CLI.

Hardening Proposals

  • proposed — Bind a session claim to an authenticated local requester or a session-scoped credential, rather than relying solely on an environment value and the existence of a live lease.
  • proposed — Explicitly clear inherited pane and terminal identities when building an ordinary structured child environment, then add back only its registered worker handle. The inspected inheritance behavior is present at this head, but its change in exposure relative to the base was not established.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.68% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 59 functions across 55 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly identifies the main change: allowing structured chat sessions to run orchestration as their own identity.
Description check ✅ Passed The description is complete and closely follows the repository template. It explains the user impact, implementation, rationale, linked issue, visual proof, testing, compatibility considerations, and …
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

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: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 2e856898-d7b8-40a6-8df3-591ab34378a9

📥 Commits

Reviewing files that changed from the base of the PR and between 7782914 and 7a0b037.

📒 Files selected for processing (66)
  • .github/workflows/pr.yml
  • .github/workflows/unit-tests.yml
  • config/scripts/pr-workflow-parallelism.test.mjs
  • config/scripts/vitest-caller-identity-env-setup.ts
  • config/tsconfig.node.json
  • config/vitest.config.ts
  • native/windows-cli-launcher/OrcaCliLauncher.cs
  • resources/darwin/bin/orca
  • resources/linux/bin/orca-ide
  • src/cli/command-spec.ts
  • src/cli/handlers/orchestration-windows-ask-cli.test.ts
  • src/cli/handlers/orchestration/dispatch-handlers.ts
  • src/cli/handlers/orchestration/message-check-handler.ts
  • src/cli/handlers/orchestration/message-send-handler.ts
  • src/cli/handlers/orchestration/question-handler.ts
  • src/cli/handlers/orchestration/run-handlers.ts
  • src/cli/handlers/orchestration/runtime-compatibility.ts
  • src/cli/handlers/orchestration/terminal-identity.ts
  • src/cli/index-orchestration.test.ts
  • src/cli/index.ts
  • src/cli/orchestration-session-caller-cli.test.ts
  • src/cli/runtime/orchestration-compatibility-envelope.ts
  • src/cli/session-caller-flags.ts
  • src/cli/session-cli-reexec.test.ts
  • src/cli/session-cli-reexec.ts
  • src/cli/specs/orchestration-worker-specs.ts
  • src/cli/specs/orchestration.ts
  • src/main/claude/claude-stream-json-connection.test.ts
  • src/main/claude/claude-structured-launch-resolution.test.ts
  • src/main/claude/claude-structured-launch-resolution.ts
  • src/main/cli/cli-self-export.test.ts
  • src/main/cli/cli-self-export.ts
  • src/main/cli/linux-bare-orca-dispatcher.ts
  • src/main/cli/linux-terminal-orca-cli-shim.test.ts
  • src/main/cli/linux-terminal-orca-cli-shim.ts
  • src/main/cli/orca-cli-child-path.ts
  • src/main/cli/windows-launcher-asset.test.ts
  • src/main/codex/codex-structured-child-environment.test.ts
  • src/main/codex/codex-structured-child-environment.ts
  • src/main/codex/codex-structured-session-adapter.test.ts
  • src/main/ipc/pty-daemon-spawn-agent-home-env.test.ts
  • src/main/ipc/pty-spawn-env-terminal-basics.test.ts
  • src/main/ipc/pty/host-env/assembly.ts
  • src/main/ipc/pty/host-env/pi-agent.ts
  • src/main/ipc/pty/host-env/spawn-env-keys.ts
  • src/main/ipc/pty/ipc/spawn-options.ts
  • src/main/ipc/pty/runtime/spawn-options.ts
  • src/main/providers/provider-dispatch.test.ts
  • src/main/runtime/orchestration/orchestration-party-cli-address.test.ts
  • src/main/runtime/rpc/methods/orchestration-structured-worker-session.test.ts
  • src/main/runtime/structured-session-child-identity-env.test.ts
  • src/main/runtime/structured-session-child-identity-env.ts
  • src/main/runtime/structured-session-cli-login-shell.live-shell.test.ts
  • src/main/runtime/structured-session-cli-login-shell.test.ts
  • src/main/runtime/structured-session-login-shell-test-harness.ts
  • src/main/runtime/structured-worker-child-identity-env.test.ts
  • src/main/runtime/structured-worker-child-identity-env.ts
  • src/main/runtime/structured-worker-identity.test.ts
  • src/main/runtime/structured-worker-identity.ts
  • src/main/ssh/ssh-remote-cli-host-passthrough.test.ts
  • src/main/ssh/ssh-remote-cli-host-passthrough.ts
  • src/shared/agent-session-caller-env.ts
  • src/shared/orca-session-address-prefix.ts
  • src/shared/orca-session-address.ts
  • src/shared/structured-session-marker.ts
  • src/shared/structured-worker-handle.ts
💤 Files with no reviewable changes (2)
  • src/main/runtime/structured-worker-child-identity-env.test.ts
  • src/main/runtime/structured-worker-child-identity-env.ts

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

Comment thread .github/workflows/unit-tests.yml Outdated
--exclude=src/main/zsh-scoped-histfile.live-shell.test.ts \
--exclude=src/main/zsh-startup-hook-user-config-equivalence.live-shell.test.ts \
--exclude=src/main/zsh-wrapper-version-mismatch.live-shell.test.ts \
--exclude=src/main/runtime/structured-session-cli-login-shell.live-shell.test.ts \

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.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

rg -n 'SHELL_PREFIXES|shell-contract|shell_contract|structured-session-cli-login-shell|pr-code-change-scope' config/scripts/pr-code-change-scope.mjs .github/workflows/pr.yml .github/workflows/unit-tests.yml

Repository: stablyai/orca

Length of output: 1796


🏁 Script executed:

set -eu
printf '%s\n' '--- current scope detector ---'
sed -n '1,120p' config/scripts/pr-code-change-scope.mjs
sed -n '380,430p' config/scripts/pr-code-change-scope.mjs
printf '%s\n' '--- workflow shell-contracts job and final gating ---'
sed -n '450,610p' .github/workflows/pr.yml
sed -n '680,730p' .github/workflows/pr.yml
sed -n '1080,1195p' .github/workflows/pr.yml
printf '%s\n' '--- unit exclusion context ---'
sed -n '45,72p' .github/workflows/unit-tests.yml
printf '%s\n' '--- relevant paths in current and base revisions ---'
git show 7a0b03752a8e5d72f670bbeb8949155c9de0745b:config/scripts/pr-code-change-scope.mjs | sed -n '70,115p'
git show 77829142acac3358e28954099b9beb67534b7a81:config/scripts/pr-code-change-scope.mjs | sed -n '70,115p'

Repository: stablyai/orca

Length of output: 28900


🏁 Script executed:

set -eu
printf '%s\n' '--- runtime test and related files ---'
git ls-files 'src/main/runtime/*structured-session*' 'src/main/runtime/*shell*' | sort
rg -n --glob '*.ts' --glob '*.tsx' 'structured-session-cli-login-shell|structured session|login shell' src/main/runtime src/main | head -120
printf '%s\n' '--- prefix matching and scope computation ---'
rg -n 'function matchesPrefix|matchesPrefix|function compute|const shouldRun|shouldRun|GLOBAL_FORCE_PREFIXES|ALWAYS_ON_CODE_JOBS' config/scripts/pr-code-change-scope.mjs
sed -n '115,220p' config/scripts/pr-code-change-scope.mjs
sed -n '300,385p' config/scripts/pr-code-change-scope.mjs

Repository: stablyai/orca

Length of output: 28306


🏁 Script executed:

set -eu
sed -n '465,485p' config/scripts/pr-code-change-scope.mjs
printf '%s\n' '--- test and harness headers ---'
sed -n '1,45p' src/main/runtime/structured-session-cli-login-shell.live-shell.test.ts
sed -n '1,35p' src/main/runtime/structured-session-login-shell-test-harness.ts

Repository: stablyai/orca

Length of output: 3676


Route the excluded test through shell contracts.

A change to src/main/runtime/structured-session-cli-login-shell.live-shell.test.ts or src/main/runtime/structured-session-login-shell-test-harness.ts does not match SHELL_PREFIXES. The shell-contracts job is skipped, while the unit shards exclude the live test.

Add both paths to SHELL_PREFIXES.

Suggested fix
 const SHELL_PREFIXES = [
+  'src/main/runtime/structured-session-cli-login-shell.live-shell.test.ts',
+  'src/main/runtime/structured-session-login-shell-test-harness.ts',
   'src/main/daemon/repro-13767-shell-ready-marker-lost-to-exec',

Comment thread src/cli/session-cli-reexec.test.ts Resolved
Comment on lines +12 to +14
const DEV_CLI_BIN_FIRST = /^[^:;]*[\\/]cli[\\/]bin[:;]/
// The dev launcher by absolute path: a login shell's profile cannot reorder it behind a global.
const DEV_CLI_LAUNCHER = /^[^:;]*[\\/]cli[\\/]bin[\\/]orca-dev$/

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '1,115p' src/main/codex/codex-structured-child-environment.test.ts
sed -n '155,180p' src/main/claude/claude-structured-launch-resolution.test.ts
sed -n '26,48p' src/main/codex/codex-structured-session-adapter.test.ts
sed -n '40,58p' src/main/cli/orca-cli-child-path.ts

Repository: stablyai/orca

Length of output: 8147


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- cited test files and imports ---'
sed -n '1,125p' src/main/codex/codex-structured-child-environment.test.ts
sed -n '145,185p' src/main/claude/claude-structured-launch-resolution.test.ts
sed -n '1,65p' src/main/codex/codex-structured-session-adapter.test.ts
printf '%s\n' '--- implementation bindings and platform helpers ---'
rg -n -C 4 'DEV_COMMAND_NAME|buildCodexStructuredChildEnvironment|orca-dev|process\\.platform|platform.*win32|isPackaged' src/main/codex src/main/claude src/main/cli src/main/runtime src/main -g '*.ts' | head -260
printf '%s\n' '--- workflow/platform support ---'
rg -n -C 3 'windows|win32|vitest|test' .github package.json pnpm-workspace.yaml 2>/dev/null | head -220

Repository: stablyai/orca

Length of output: 41364


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- Windows workflow declarations ---'
find .github -maxdepth 3 -type f -print | sort
for f in $(find .github -maxdepth 3 -type f \( -name '*.yml' -o -name '*.yaml' \) -print | sort); do
  if rg -q -i 'windows|win32|pnpm test|vitest run|test:' "$f"; then
    printf '%s\n' "--- $f ---"
    rg -n -C 5 -i 'windows|win32|pnpm test|vitest run|test:' "$f"
  fi
done
printf '%s\n' '--- cited-file platform guards ---'
rg -n -C 2 'skipIf|process\\.platform|platform|win32|win' \
  src/main/codex/codex-structured-child-environment.test.ts \
  src/main/claude/claude-structured-launch-resolution.test.ts \
  src/main/codex/codex-structured-session-adapter.test.ts || true

Repository: stablyai/orca

Length of output: 41736


🏁 Script executed:

#!/bin/bash
set -e
for f in .github/workflows/pr.yml .github/workflows/unit-tests.yml .github/workflows/computer-e2e.yml; do
  printf '%s\n' "--- $f ---"
  rg -n -C 8 'runs-on:.*windows|windows-2022|matrix\\.os|vitest run|pnpm test|src/main/codex|src/main/claude|structured-child|structured-launch|structured-session' "$f" || true
done

Repository: stablyai/orca

Length of output: 17568


Make the development launcher assertions platform-aware.

When these tests run on Windows, the unpackaged launcher is orca-dev.cmd, and its absolute path is drive-qualified. The current regexes reject the .cmd suffix and the drive letter. Reuse one helper across all three tests that uses path.basename for the launcher name and PATH.split(path.delimiter)[0] for the first PATH entry.

Comment on lines +58 to +59
...childEnv,
...(identity ? { ORCA_TERMINAL_HANDLE: identity.handle } : {}),

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '1,115p' src/main/runtime/structured-session-child-identity-env.ts
sed -n '55,105p' src/main/runtime/structured-session-child-identity-env.test.ts
sed -n '270,300p' src/main/claude/claude-structured-launch-resolution.ts
sed -n '1,85p' src/main/codex/codex-structured-child-environment.ts

Repository: stablyai/orca

Length of output: 9850


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- exact environment identifier references ---'
rg -n --glob '*.ts' --glob '*.tsx' --glob '*.js' --glob '*.json' 'ORCA_TERMINAL_HANDLE|ORCA_PANE_KEY|injectedSessionAddress|structuredSessionChildIdentityEnv|resolveClaudeStructuredInvocation|buildCodexStructuredChildEnvironment' src test 2>/dev/null | head -240
printf '%s\n' '--- candidate Claude/Codex environment construction ---'
rg -n --glob '*.ts' 'childEnv|baseEnv|launch\.env|process\.env|environment|env:' src/main/claude src/main/codex src/main/runtime 2>/dev/null | head -240
printf '%s\n' '--- relevant files ---'
git ls-files | rg 'structured|identity|claude|codex|terminal|pane|caller|orchestration' | head -240

Repository: stablyai/orca

Length of output: 41982


🤖 get_repo_knowledge executed:

get_repo_knowledge stablyai/orca /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions

Length of output: 44144


🏁 Script executed:

rg -n --glob '*.ts' --glob '*.tsx' 'ORCA_TERMINAL_HANDLE|ORCA_PANE_KEY|injectedSessionAddress|structuredSessionChildIdentityEnv|resolveClaudeStructuredInvocation|buildCodexStructuredChildEnvironment|launch\.env|childEnv' src | head -300

Repository: stablyai/orca

Length of output: 33263


🏁 Script executed:

rg -n --glob '*.ts' --glob '*.tsx' 'ORCA_TERMINAL_HANDLE|ORCA_PANE_KEY|injectedSessionAddress|structuredSessionChildIdentityEnv|resolveClaudeStructuredInvocation|buildCodexStructuredChildEnvironment|launch\.env|childEnv' src

Repository: stablyai/orca

Length of output: 41979


Clear inherited terminal context before building the structured child environment.

Claude starts from process.env, and this helper spreads that environment. A chat without a registered worker can therefore retain inherited ORCA_TERMINAL_HANDLE and ORCA_PANE_KEY. The session ID still wins for orchestration caller resolution, so the inherited handle does not change injectedSessionAddress there. Hook and handle-based consumers can still attribute activity to the parent.

Suggested fix
  const env: Record<string, string> = {
    ...childEnv,
-   ...(identity ? { ORCA_TERMINAL_HANDLE: identity.handle } : {}),
    [ORCA_AGENT_SESSION_ID_ENV]: sessionId,
    [ORCA_STRUCTURED_SESSION_ENV]: '1'
  }
+ delete env.ORCA_TERMINAL_HANDLE
+ delete env.ORCA_PANE_KEY
+ if (identity) {
+   env.ORCA_TERMINAL_HANDLE = identity.handle
+ }

…ve Codex, the terminal view, WSL, PTY inheritance and SSH
…verb that names its caller

Adds the per-verb table (flagless acts as the session; a conflicting --from or
--terminal is refused before any request; the session's own spellings are
accepted), the enumerated guess population with its positive control, the
structured worker's own handle, the identity-less refusal for an older child,
the unchanged terminal agent, and the envelope. dispatch-show's --from only fills
preview text, so it passes through unfenced and a session's flagless preview
names the address the real dispatch writes.
…LIs that predate it

A CLI older than the id, reached through a global install when a shell rc resets
PATH, would otherwise guess a sibling's terminal in a chat that no longer carries
the marker. It refuses on the marker instead; a current CLI checks the id first,
so the marker never makes a session with an id identity-less.
…-list scoped by --run

A --run listing needs no caller, so both handlers skipped the resolver and a
--from naming another actor was dropped silently under a session. The conflict
check now runs on that branch too; terminal callers are unchanged.
…ured session's login shells

A provider can run each command in a login shell: Codex runs zsh -lc, and the
profile rebuilds PATH, putting a global install (possibly an older Orca) ahead of
the directory Orca prepended. ORCA_CLI_COMMAND, which an agent resolves the CLI
from first, is now the absolute launcher in that directory (the native launcher
on Windows), so no shell's startup files can swap it. The PATH prepend stays for
shells that read no profile. Found by the live coordinator run of the next PR.
…ne that installs zsh

The ordinary Linux unit lane has no /bin/zsh, so the zsh arm failed there with
ENOENT. It moves to a live-shell file registered in the shell-contracts lane; the
bash arm keeps running in every lane. The lane guard's detector now also sees a
zsh spawned through the ProcessSpec program field, which is how this test
escaped it.
…ncher resolves, and pin its instance

A bare `orca` fallback named GNOME's screen reader on packaged Linux, and an inherited value named
another app's CLI. The builder now deletes any inherited value, sets the absolute launcher only when
one resolved, and pins ORCA_USER_DATA_PATH so a current CLI dials the instance that minted the id.
Renames the marker reader to hasStructuredSessionMarker and records why the terminal view carries
the id without the marker.
… local terminal

ORCA_CLI_COMMAND meant three things by lane: an absolute launcher for a structured session, a bare
name for WSL, and nothing for any other terminal, so a structured session's terminal view lost it.
Local terminals now get the same absolute launcher the structured lane gets; WSL keeps its guest
command name, and a terminal whose launcher does not resolve still gets none.
…CLI was invoked

A login shell can reorder PATH behind a global install, and an agent or its helper script can run
bare `orca`, so the binary that answered depended on the agent following instructions. Orca's
packaged launchers and bare-orca shims now export ORCA_CLI_SELF (outermost wins). At the CLI entry,
when it names a different launcher than ORCA_CLI_COMMAND, the command re-runs once through the named
launcher with ORCA_CLI_REEXEC=1 and exits with its status; both variables are consumed so no child
inherits them. Dev launchers export no self on purpose, WSL and SSH names never qualify, and a
launcher that cannot start leaves the command to run here. The Windows launcher no longer rewrites
ORCA_CLI_COMMAND; the legacy ask protocol normalizes its resume command itself.
…spec and refuse at the CLI entry

Each handler hand-classified its --from/--terminal as the caller or a target, and the refusal of a
conflicting caller flag ran inside the caller resolver plus two standalone calls for --run listings,
so a new verb that read its flag raw would pass a sibling's handle to a pre-session host. Specs now
declare identityFlagRoles, the CLI entry refuses a conflicting caller flag once from the spec, the
resolver only applies the id-wins rule, and a test fails any orchestration verb that accepts --from
or --terminal without classifying it.
… graph

The check runs at the CLI entry for every command, and the actor codec pulls zod through the session
record. Compare the session's own spellings as plain strings instead.
…, off the codec's module graph

The Orca session address prefix moves to a leaf module with no imports, re-exported by
the address codec, so the CLI entry check derives `session:<id>` from that constant
instead of re-typing it and still stays off the codec's zod graph. Prose and test names
say caller or Orca session id, not actor.
…w that the handoff is gone

The terminal handoff was removed, so no terminal is ever a structured session:
- delete the terminal-view identity env and its WSL passthrough, and their tests;
- strip the session caller keys from every terminal's env unconditionally;
- the CLI's own-address spelling moves beside the injected id in src/shared, with
  a test pinning it to the address the host's party resolver gives that session.
…minal names

Packaged Linux names the userData shim in ORCA_CLI_COMMAND, while the preflight
ran the bundled launcher behind it. The CLI saw a different launcher and handed
the preflight off to the shim, booting Electron twice before every codex launch.
… preflight

Only a structured session needs an absolute ORCA_CLI_COMMAND; local terminals go back to
naming none (WSL keeps its guest command), and the Codex launch preflight goes back to the
bundled launcher. The CLI handoff is scoped to sessions, so a terminal's preflight can no
longer be handed off and start Electron twice.

This reverts commit d2cefb6 and commit dd2853a.
The handoff ran whenever an Orca launcher's ORCA_CLI_SELF differed from an absolute
ORCA_CLI_COMMAND, so any process with both - a terminal, a script - ran another install's CLI
instead of the one invoked: a beta's --version lied, and an AppImage command from a terminal
that outlived its Orca failed. It now requires the injected session id, the identity it exists
to deliver. The launcher variables are still consumed in every process.
The launcher stopped writing orca/orca-ide over ORCA_CLI_COMMAND so the handoff could see a
session's absolute launcher, which also changed what every Windows terminal's CLI read. The CLI
entry now applies the launcher's rule itself once the handoff is decided, so terminals and the
legacy ask resume command see exactly what they saw before, and the resume-command reader
goes back to its original form.
…ot a launcher export

Every packaged launcher, shim and dispatcher exported ORCA_CLI_SELF so the CLI could tell which
launcher ran it, and compared that with the session's ORCA_CLI_COMMAND. Two launchers of the same
app are different files, so a session that reached its own app through a global orca-ide on Linux
still handed off and started Electron twice, and the export rode artifacts every terminal uses.

A structured session now also names the JS entry its launcher runs (ORCA_SESSION_CLI_ENTRY), and
the CLI compares its own argv entry with it: any launcher of the same app stays, another install
hands off. The launcher scripts, Linux shim and dispatcher go back to main; the Windows launcher
keeps only leaving ORCA_CLI_COMMAND for the CLI to name after the handoff decision.
…injected id already bind any current CLI

Every current Orca CLI dials the instance ORCA_USER_DATA_PATH names and sends the injected
session id in the orchestration envelope, so a bare `orca` that reaches another install's
current CLI already acts as the session. An older CLI has no handoff code and refuses on the
marker. The handoff only lined up versions between two current CLIs, and comparing two
separately derived paths kept misfiring (an AppImage's mount against its registered
extraction started the CLI twice on every call).

Removes the re-exec, ORCA_SESSION_CLI_ENTRY and ORCA_CLI_REEXEC, and the CLI-side Windows
command naming; the packaged Windows launcher rewrites ORCA_CLI_COMMAND again, as on main,
inside its own process only. resolveHostCliEntryPath goes back to the SSH passthrough.
…le, now that every session's env is populated
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