Repository navigation
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (5)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughOrchestration worker starts now accept an omitted Merge Risk: 🟡 Moderate · up to This change makes omitted --agent use the configured default, but current validation still has bounded correctness risks: some invalid explicit values may be accepted as the default, terminal reuse may accept an empty value, and the unavailable-default error contract is not fully protected by tests. Merge should wait for these cases to be corrected or explicitly accepted by the owner. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Docstring CoverageExplanation 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 7 functions across 3 files. (2 skipped: 1 unsupported, 1 too large.) 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/runtime/rpc/methods/orchestration-worker-start-validation.ts (1)
145-177: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winReject an invalid explicit agent before default resolution.
Line 147 uses the Settings default when
args.agentis present but invalid. Localworker-start --agent unknowncan then launch the default agent. Federated worker-start rejects the same input at lines 45-48.Only resolve the default when the caller omitted
--agent.Proposed fix
+ const explicitAgent = parseTuiAgent(args.agent) + if (!args.terminal && args.agent && !explicitAgent) { + throw new OrchestrationError('agent_unconfigured', args.missingAgentMessage) + } const agent = args.terminal ? undefined - : (parseTuiAgent(args.agent) ?? resolveDefaultWorkerAgent(args.runtime)) + : (explicitAgent ?? resolveDefaultWorkerAgent(args.runtime))
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3c84513f-3622-4443-81b1-85a9992a948c
📥 Commits
Reviewing files that changed from the base of the PR and between 6b51ef4 and a82fc1f2f0fe17d380e4c7c61fe90d3ca4496fda.
📒 Files selected for processing (5)
skill-guides/orchestration.mdsrc/cli/bundled-skill-guides.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/orchestration-worker-start-validation.test.tssrc/main/runtime/rpc/methods/orchestration-worker-start-validation.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
CodeRabbit feedback addressed
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f42edca4-8ea0-40ee-9780-d7586ca5e285
📥 Commits
Reviewing files that changed from the base of the PR and between a82fc1f2f0fe17d380e4c7c61fe90d3ca4496fda and 1f6d6dd772e72454c00aada966a2250ea5757d91.
📒 Files selected for processing (3)
skill-guides/orchestration.mdsrc/cli/bundled-skill-guides.tssrc/main/runtime/rpc/methods/orchestration-worker-start-validation.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.
|
Follow-up from an internal audit (
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6a843c7f-c2c0-4c88-9575-2b4be29d7337
📥 Commits
Reviewing files that changed from the base of the PR and between 1f6d6dd772e72454c00aada966a2250ea5757d91 and 174f9da8aa114840957f58eff015e8571da9103e.
📒 Files selected for processing (5)
skill-guides/orchestration.mdsrc/cli/bundled-skill-guides.tssrc/cli/specs/orchestration-worker-specs.tssrc/main/runtime/rpc/methods/orchestration-worker-start-validation.test.tssrc/main/runtime/rpc/methods/orchestration-worker-start-validation.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
|
Addressed ( |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/runtime/rpc/methods/orchestration-worker-start-validation.ts (1)
145-152: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winReject an explicit empty agent in terminal mode.
resolveWorkerStartAgentskips validation whenargs.terminalis set. The caller also checksparams.agentby truthiness, so--terminal --agent ""reaches this terminal branch and succeeds. This silently ignores an explicit invalid agent.Check explicit-agent presence with
!== undefinedbefore the terminal branch, or reject the combination in the worker-start validator.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a4ec9324-3228-4cc0-a59f-c527eafa294f
📥 Commits
Reviewing files that changed from the base of the PR and between 174f9da8aa114840957f58eff015e8571da9103e and af4b696d66f40ff423fe7584baa7a2bd19a3ddbc.
📒 Files selected for processing (2)
src/main/runtime/rpc/methods/orchestration-worker-start-validation.test.tssrc/main/runtime/rpc/methods/orchestration-worker-start-validation.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Workers only take the agent from an explicit --agent flag; the guide's examples showed claude/codex only, so coordinators never dispatched Bob. Co-Authored-By: Claude Fable 5 <[email protected]>
…ault agent Coordinators had to name an agent on every worker-start and the guide only showed claude/codex, so the user's default agent was never used. An omitted --agent now resolves to the enabled Settings default; an explicit --agent still wins and a missing/disabled default still fails with agent_unconfigured. Co-Authored-By: Claude Fable 5 <[email protected]>
…agents Type the fake runtime with TuiAgent, assert terminal reuse never consults the default resolver, and drop IBM Bob from the guide examples until that agent lands. Co-Authored-By: Claude Fable 5 <[email protected]>
…e default Only an omitted --agent falls back to the Settings default; an unknown id fails as before. CLI usage and retry guidance now describe --agent as optional. Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
af4b696 to
e9c1e7a
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Greptile SummaryThe PR makes supervised worker creation resolve an omitted
Confidence Score: 4/5The explicit empty-agent path should be fixed before merging because it can silently launch the Settings default instead of rejecting the caller’s invalid selection. The new fallback is sound for genuinely omitted values, but existing CLI and RPC normalization collapses an explicitly empty agent into the same undefined representation, defeating the changed resolver’s intended invalid-input check. Files Needing Attention: src/main/runtime/rpc/methods/orchestration-worker-start-validation.ts, src/main/runtime/rpc/methods/orchestration-worker-start-validation.test.ts
|
| Filename | Overview |
|---|---|
| src/main/runtime/rpc/methods/orchestration-worker-start-validation.ts | Adds default-agent fallback, but parser-normalized empty explicit values become indistinguishable from omission and can launch the default agent. |
| src/main/runtime/orca-runtime.ts | Adds a Settings-backed resolver that returns only recognized, enabled default agents. |
| src/main/runtime/rpc/methods/orchestration-worker-start-validation.test.ts | Covers core resolution behavior, although its empty-string case bypasses the real CLI and RPC normalization path. |
| src/cli/specs/orchestration-worker-specs.ts | Updates worker-start usage and retry guidance to describe the optional agent and Settings fallback. |
| skill-guides/orchestration.md | Revises orchestration examples and guidance to prefer the user’s default agent. |
| src/cli/bundled-skill-guides.ts | Regenerates the bundled orchestration guide from the updated source documentation. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
CLI[worker-start request] --> A{terminal supplied?}
A -->|Yes| R[Reuse existing terminal]
A -->|No| B{agent present?}
B -->|Valid explicit ID| V[Validate enabled launcher]
B -->|Omitted| D[Resolve worker-host Settings default]
B -->|Invalid explicit ID| E[agent_unconfigured]
D --> C{Default recognized and enabled?}
C -->|Yes| V
C -->|No| E
V --> L[Create supervised worker]
Reviews (1): Last reviewed commit: "fix(orchestration): treat an empty --age..." | Re-trigger Greptile
| const agent = args.terminal | ||
| ? undefined | ||
| : (parseTuiAgent(args.agent) ?? resolveDefaultWorkerAgent(args.runtime)) |
There was a problem hiding this comment.
Fixed in f18956a. The leak was CLI-side, as you said: getOptionalStringFlag collapses --agent "" (and bare --agent) to undefined before the resolver's !== undefined guard could see it. The handler now rejects an explicitly empty or valueless --agent (and --terminal) with invalid_argument at the CLI boundary — matching main's failure on the same input. The RPC path was already covered: the schema's .min(1) rejects an empty string rather than converting it.
…oundary getOptionalStringFlag collapses --agent "" and bare --agent to undefined, so the resolver's explicit-empty guard never saw them and worker-start launched the Settings default. Reject them (and --terminal "") in the handler with a clear invalid_argument error, matching main's failure on the same input. The validation tests now also pin the agent_unconfigured error code. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Closing as part of consolidating the IBM Bob stack into a single PR, #20397. To be clear about the record: this change is not superseded and is not included in #20397. It only shared a branch base with the Bob work; the content — defaulting Closed to unstack, not because it was rejected. The 6 commits are intact on |
|
Resubmitted standalone against current |
ELI5
orca orchestration worker-startnow launches the user's default agent (from Settings) when the coordinator doesn't pass--agent.What Changed
worker-startwithout--agentresolves todefaultTuiAgentwhen that agent is enabled (OrcaRuntimeService.resolveDefaultOrchestrationAgent). An explicit--agentstill wins; a missing,blank, or disabled default still fails withagent_unconfigured— the default is never silently swapped for another agent.--terminalreuse is unchanged.--agent; an omitted one is resolved by the worker host against its own Settings.--agentto use the user's default; pass it only when a specific agent is called for", with examples; bundled guide regenerated.--terminalreuse.Why
Workers only ever took the agent from an explicit
--agent, and the guide's examples showedclaude/codex, so coordinators always dispatched Claude regardless of the user's default agent (observed in dispatch receipts:requested.agent: "claude"on every worker). The orchestration path now follows the same default the new-workspace picker uses.Linked Issue
Fixes #
Visual Proof
N/A — CLI/RPC behavior only. Receipt before:
launch.requested.agent: "claude"with no--agentpossible; after: omitted--agent→launch.requested.agentequals the Settings default.Testing
macOS (Darwin 25.5.0):
pnpm vitest run src/main/runtime/rpc/methods src/main/runtime/orchestration src/cli→ 2355 passed.Live: Settings default = IBM Bob;
orca orchestration worker-start --task <id> --worktree current --json(no--agent) →launch.effective.agent: "bob", workersucceeded,worker_donereceived by the coordinator.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Claude (Fable 5) via Claude Code assisted with analysis, implementation and testing; reviewed and run locally by the author.
Review
Agent skill upstream boundary
N/A