Repository navigation
feat(T14500): launch guarded Claude leads inside Orca terminals - #2829
Open
kryptobaseddev wants to merge 3 commits into
Open
kryptobaseddev wants to merge 3 commits into
kryptobaseddev wants to merge 3 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Inside a local POSIX Orca session,
cleo orchestrate leadnow opens a Claude Code terminal using the native provider's production guard builder. The launch carries the denied/allowed tools, permission mode, empty setting sources, strict MCP file, settings hooks and allocated session unchanged. A private first-turn gate waits for the exact local runtime/workspace, visible terminal, fresh UI navigation and matching connected terminal, supervisor PID, mailbox admission and persisted PID.execpreserves that PID; the result supplies the exact terminal handle for supervision.Orca refusals propagate their code, message, fix and nonzero CLI exit instead of becoming
success:truewith a failed status. Environment/workspace and startup refusals precede mailbox admission; failure after admission releases it. Known newly created terminals are closed. Lost create receipts never trigger a retry or a guessed close: deleting the private gate aborts that shell promptly. Partial Orca context hints without a terminal handle refuse loudly with a repair instruction; the native route remains available outside Orca. Inside Orca,--detachedreturns while--printruns in a visible terminal (focused to prove UI adoption), with mbx retained as its owner channel.Refs: T14500 AC1,AC2
AC1 evidence:
lead-mcp.test.tsinspects argv, real--settings, strict runner/user-mbx configuration, provider session id and CLEO identity for both modes. It also proves coded refusals survive the adapter and generic setup failures receive actionable nonzero refusals.orca-execution.test.tsexecutes only an inert recording binary. It proves argument/environment quoting, awaited admission before first turn, early Windows/missing-handle/remote-workspace refusal, visibility loss after create, failed navigation, PID mismatch, disconnected terminals, changed runtime, lost receipt shutdown, exact-handle cleanup and reported unverified cleanup.success:false, preserves code/message/fix and sets exit status 63.surface:visible, show omitssurface, switch returns an exactfocusreceipt withnavigated:true, and close returnsptyKilled:true. The implementation checks fresh navigation and matching re-show identity, and rejects an explicitly hidden re-show. These probes launched no model or worker and their terminals were closed.orchestrate.leadWorker.v1enabled. Runcleo orchestrate lead <disposable-epic> --adapter claude-code. Capturedata.leadTerminalanddata.lead; inspect the returned handle withorca terminal show --terminal <handle> --jsonandorca terminal read --terminal <handle> --screen --json, and its PID withps -p <pid> -o command=. Verify the denied/allowed tools, Manual permission mode, empty setting sources, strict MCP,--settings, provider session id, actual tool/server inventory and an owner question in that terminal. The fixture preserves pre-turn settings/MCP contents; SessionStart removes the MCP file. End the disposable session and confirm its claim/mailbox release. Do not use or interrupt the dogfood lead. Attach this evidence before AC1 closure.AC2 evidence:
Validation on head
d9d4872d336279b3c9d7cb6c2a098752fb87e67c(single files throughcleo run --wait --class test -- pnpm exec vitest run <file>):packages/adapters/src/__tests__/orca-execution.test.ts: 94 passed.packages/adapters/src/providers/claude-code/__tests__/lead-mcp.test.ts: 21 passed.packages/core/src/orchestrate/__tests__/lead.test.ts: 28 passed, with--config temp/vitest.lead-local.ts.packages/cleo/src/cli/commands/__tests__/orchestrate-orca-routing.test.ts: 30 passed, with--config temp/vitest.orca-cli-local.ts.Current-head CI: Linux/macOS builds and build verification, packed artifacts, full lint and typecheck, documentation coverage, Repo Lints, Post-build Checks and release readiness passed. All eight Ubuntu unit-test shards passed. macOS shards 1, 2 and 4 passed; shard 3 failed in the unchanged
brain-search-readonly.test.ts(missing/stale FTS setup waits 1008–1430 ms under a held write lock, including the automatic rerun). The failure stack is confined to memory/brain-search and its existing test; this PR changes neither that path nor store code. Follow-up T14509 is filed under the existing epic T12956. CI failure log. The foreground CI watch finished with exit 1. The CI aggregate is red from that test dependency; cleo/merge-close is red because AC1 and AC2 have no independent verdict on this head.Skipped additional harnesses and profile/plugin APIs. The unrelated BRAIN CI failure, live check and independent verdicts on the current head are unresolved; this partial-delivery PR intentionally does not close T14500.
CI check states captured after the foreground watch on this head: