You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use the shared default agent selection for work-item launches - #35748
Launching a work item could open Claude even when Codex was preferred and its chat was usable. Preflight considered detected CLIs only, then passed its inferred fallback as an explicit choice. Paired-host launches could also use desktop preferences where a new agent tab used the workspace host's preferences.
Direct work-item launches now share the workspace default resolver and owner-preference reader used by new agent tabs. A usable preferred chat stays ahead of a detected fallback, and only an explicit user choice becomes an override. Final selection reads the actual created workspace's inventory. If the selected agent changes, its replacement plan and startup use the same current settings snapshot.
The launch path also skips workspace-root lookup when no custom working directory is requested. The real default-launch/acquisition contract at 100 and 1,000 worktrees checks zero unnecessary root calls/row visits, bounded offered-agent route evaluations, the selected plan and released subscriptions. This does not claim the whole launch is constant time.
Tracked in STA-12494; the original regression came from #30449. Routing/test overlap with #34657 preserves its separate detection-failure behavior. The narrow menu performance assertion is coordinated with #34728; picker UI is unchanged.
Review path: full, because this changes default-agent selection and host-derived inputs to a user action. No saved field, wire operation, server minimum, process lifecycle implementation or visual layout changes.
The common pattern derives selection from the destination's settings and available providers while preserving explicit intent. Intended adapters: Orca supports CLI or native chat across local, SSH and paired hosts, including independently updated clients and servers. The shared synchronous reader keeps the existing desktop fallback when current host preferences are absent or unsupported; supplied preference snapshots remain authoritative. Final inferred defaults are reread after acquisition, while matching-agent preflight adoption retains its existing contract. Blank workspace creation still opens no agent; an explicit new-agent-tab action may auto-pick.
Onboarding replays its configured enabled agent; dashboard offers a list including running agents; composer selection preserves touched/draft input; empty-workspace seeding may retain a shell. These distinct contracts are intentionally unchanged. No temporary reference deviation remains.
Validation: CI passed on 5e6f22e48a889bf3bb9cb7898744b43c11408cca (run 40866623677): all ten unit shards, Linux and Windows packaging, and required checks. The changed-code casting gate executed with zero new findings. Both compiler guards were true and all four normal compiler programs, including web/composite checking, actually executed and passed; no TS2883 or replacement error remained. Retained explicit results for all twelve required suites include defaults (13 cases), menu (8 cases), delayed availability, and the 100/1,000-workspace contract. The final supplemental commit changes only the fixture casting comment; its types and runtime expressions are unchanged. Changed flows are renderer selection/route construction and performance under the review skill's tests row. There is no appearance change requiring a screenshot and no lifecycle/process/login implementation requiring application or live-agent QA. No live-agent pass is claimed. Commits were made normally without bypass flags; this dependency-free worktree lacks the generated Husky launcher, so no pre-commit-hook pass is claimed. CI is the lint/compiler gate.
[Medium impact] The change since the previous review appears safe to merge.
Summary
Work-item launches now share workspace default-agent selection and host preferences with new agent tabs.
Work-item launches follow the destination host’s current agent choice.
Default launches skip workspace-root lookups when no custom directory is set.
Since the previous review, only a targeted lint suppression was added to the shared test fixture. No new actionable issue or mounted-rule violation was found.
Preferred chat opens a terminalsrc/renderer/src/lib/launch-work-item-direct-route-preparation.ts:163▶
If the default changes from Claude to a detected, host-registered agent such as pi during workspace creation, this branch builds the replacement plan without waiting for the host's agent list. Claude's preflight does not need that list, and resolveDirectWorkItemAgent skips discovery because the new agent's CLI is detected. If the list has not loaded yet, the plan chooses terminal-tui even though the host supports chat for pi. The background refresh does not repair this launch.
Await awaitStructuredRouteHostAnswer for the replacement request before building its plan.
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.
Direct launch and new-tab agent selection now share workspace-aware default resolution and host-preference reading. Launch preparation uses the selected agent’s store for launch state and accepts a preflight plan only when its agent matches the effective agent. Route-input construction skips the workspace-root check when no custom working directory is supplied. Tests cover preference updates, agent selection, launch behavior, and bounded route-input construction.
Priority: Normal
Merge Risk: Low · up to 57bae
The implementation is supported, but a focused regression test is needed to prevent the new-tab preference behavior from silently regressing.
Pre-merge checks: 3 · 2
Failed checks: 2 warnings
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check
The description explains the problem, implementation, scope, compatibility considerations, and validation in detail. However, it does not follow the required template structure. It lacks an actual lin…
Update the description to use the required template headings and checklist. Add the actual issue link in the Fixes #... field, or document the applicable maintainer exception. Add N/A with a brief reason for visual proof. Complete the T…
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title clearly identifies the main change: direct work-item launches now use the shared default agent selection.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 8 functions across 13 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Full details: Description check
Explanation
The description explains the problem, implementation, scope, compatibility considerations, and validation in detail. However, it does not follow the required template structure. It lacks an actual linked issue in the required Fixes # format, explicit N/A visual proof, the Testing and Agent skill upstream boundary checkboxes, and the required checklist. The validation statements also conflict with the PR objectives, which state that CI and review validation were pending, while the description states that CI passed.
Resolution
Update the description to use the required template headings and checklist. Add the actual issue link in the Fixes #... field, or document the applicable maintainer exception. Add N/A with a brief reason for visual proof. Complete the Testing, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections. Reconcile the conflicting CI and validation status statements.
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Direct work-item launches could choose a detected fallback instead of a usable preferred chat because preflight omitted chat eligibility and promoted its inference into an explicit override. On paired hosts, direct launch also used desktop preferences where a new tab used the workspace owner's preferences.
The change now shares the workspace preference source and default picker, preserves explicit choices, detects the actual created workspace's agents, and uses one current snapshot for changed-agent replacement planning and startup. It also skips unnecessary root traversal when no custom working directory is requested.
Full review completed through round 6. Repairs covered the owner source, actual destination inventory, settings freshness, the real acquisition performance contract, and contract-faithful tests with real availability publication, activation and cleanup. Final panels settled the resource fixture, public mock type boundary and cumulative growth; production remained unchanged after the accepted repair. No open P0/P1 or known worse user behavior. Deferred concerns only: a different cold-preference policy and universal same-agent preflight revalidation; no concrete failing input was established, and existing policies were retained.
Intended distinctions: blank creation versus an explicit new-agent-tab action; supplied preference snapshots; synchronous cold/unsupported-host fallback; existing matching-agent preflight adoption; CLI/chat and mixed-host adapters. Onboarding, dashboard, composer and shell-seeding contracts are intentionally unchanged. Whole-mechanism reference comparison is complete; no temporary deviation remains.
CI passed on 5e6f22e48a889bf3bb9cb7898744b43c11408cca (run 40866623677): all ten unit shards, Linux and Windows packaging, and required checks. The casting gate actually executed with zero new findings; both compiler guards were true and all four normal compiler programs, including web/composite, actually executed and passed. No TS2883 or replacement compiler error remains. Explicit passing evidence from the runtime-equivalent parent covers all twelve required suites, defaults (13 cases), menu (8 cases/full 60-row matrix), delayed availability, and the 100/1,000-workspace acquisition/performance contract. The final commit is the authorized one-line casting-comment change on 57bae606; no type or runtime expression changed. Production has been unchanged since the accepted repair and final main sync. The prior blocked status is superseded by this completed validation.
All changed flows are renderer selection/route/performance tests rows (qa=tests). No appearance, process ownership, session lifecycle or provider-login implementation changed; no screenshot or live-agent run was required or claimed. Normal commits used no bypass flags; the generated hook was absent in this checkout, so no hook pass is claimed.
Add a regression case for a chat-capable preferred agent.
resolveTerminalAgentTabShortcut passes chatIn to resolveDefaultAgentForNewTab. Add a test where the configured preferred agent is chat-usable but absent from detectedAgentIds, and assert that the preferred agent is selected. Existing tests do not exercise this branch. A future loss of chatIn forwarding could therefore regress this shortcut without failing an existing assertion.
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: f407aa88-0d94-4305-ba1a-32a6d7629f42
Commits
Reviewing files that changed from the base of the PR and between 72c5697 and 57bae60.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
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
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.
Launching a work item could open Claude even when Codex was preferred and its chat was usable. Preflight considered detected CLIs only, then passed its inferred fallback as an explicit choice. Paired-host launches could also use desktop preferences where a new agent tab used the workspace host's preferences.
Direct work-item launches now share the workspace default resolver and owner-preference reader used by new agent tabs. A usable preferred chat stays ahead of a detected fallback, and only an explicit user choice becomes an override. Final selection reads the actual created workspace's inventory. If the selected agent changes, its replacement plan and startup use the same current settings snapshot.
The launch path also skips workspace-root lookup when no custom working directory is requested. The real default-launch/acquisition contract at 100 and 1,000 worktrees checks zero unnecessary root calls/row visits, bounded offered-agent route evaluations, the selected plan and released subscriptions. This does not claim the whole launch is constant time.
Tracked in STA-12494; the original regression came from #30449. Routing/test overlap with #34657 preserves its separate detection-failure behavior. The narrow menu performance assertion is coordinated with #34728; picker UI is unchanged.
Review path: full, because this changes default-agent selection and host-derived inputs to a user action. No saved field, wire operation, server minimum, process lifecycle implementation or visual layout changes.
The common pattern derives selection from the destination's settings and available providers while preserving explicit intent. Intended adapters: Orca supports CLI or native chat across local, SSH and paired hosts, including independently updated clients and servers. The shared synchronous reader keeps the existing desktop fallback when current host preferences are absent or unsupported; supplied preference snapshots remain authoritative. Final inferred defaults are reread after acquisition, while matching-agent preflight adoption retains its existing contract. Blank workspace creation still opens no agent; an explicit new-agent-tab action may auto-pick.
Onboarding replays its configured enabled agent; dashboard offers a list including running agents; composer selection preserves touched/draft input; empty-workspace seeding may retain a shell. These distinct contracts are intentionally unchanged. No temporary reference deviation remains.
Validation: CI passed on
5e6f22e48a889bf3bb9cb7898744b43c11408cca(run 40866623677): all ten unit shards, Linux and Windows packaging, and required checks. The changed-code casting gate executed with zero new findings. Both compiler guards were true and all four normal compiler programs, including web/composite checking, actually executed and passed; no TS2883 or replacement error remained. Retained explicit results for all twelve required suites include defaults (13 cases), menu (8 cases), delayed availability, and the 100/1,000-workspace contract. The final supplemental commit changes only the fixture casting comment; its types and runtime expressions are unchanged. Changed flows are renderer selection/route construction and performance under the review skill's tests row. There is no appearance change requiring a screenshot and no lifecycle/process/login implementation requiring application or live-agent QA. No live-agent pass is claimed. Commits were made normally without bypass flags; this dependency-free worktree lacks the generated Husky launcher, so no pre-commit-hook pass is claimed. CI is the lint/compiler gate.