Repository navigation
Preserve user-set workspace names across branch changes - #17448
Conversation
Greptile SummaryThis PR adds explicit display-name provenance so user-pinned workspace labels survive branch changes while generated labels continue following Git identity.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/main/ipc/worktree-display-name.ts | Centralizes display-name sanitization, legacy request interpretation, and pinned-versus-generated metadata resolution. |
| src/main/ipc/worktree-remote.ts | Applies provenance-aware display-name resolution consistently to local and remote worktree creation. |
| src/main/ipc/worktree-metadata-merge.ts | Projects persisted pinning metadata into fixed or automatic catalog display-name behavior. |
| src/main/runtime/orca-runtime.ts | Carries display-name provenance through runtime creation and metadata update boundaries. |
| src/renderer/src/store/slices/worktrees/listing/fetched-worktree-merge.ts | Reconciles fetched host metadata with renderer state while preserving explicit labels and refreshing automatic ones. |
| src/renderer/src/store/slices/worktrees/metadata/worktree-meta-persist.ts | Persists renderer display-name changes together with their fixed or automatic provenance. |
| mobile/src/tasks/source-workspace-create.ts | Marks manually edited mobile workspace labels as user-owned while leaving auto-managed branch labels unpinned. |
| src/shared/worktree/display-name-provenance.ts | Defines the shared conversion between wire-level display-name mode and persisted pinning metadata. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Workspace creation request] --> B[Creation path: desktop, CLI, mobile, SSH, or RPC]
B --> C[Host resolves and sanitizes display name]
C --> D{Display-name provenance}
D -->|User| E[Persist pinned display name]
D -->|Generated| F[Persist automatic provenance]
E --> G[Merge Git facts with metadata]
F --> G
G --> H{Branch changes?}
H -->|Pinned| I[Keep user label]
H -->|Automatic| J[Derive label from current branch]
I --> K[Publish workspace catalog]
J --> K
Reviews (11): Last reviewed commit: "refactor(workspaces): unify display-name..." | Re-trigger Greptile
There was a problem hiding this comment.
ℹ️ No critical issues — one design question and two minor nits below.
Reviewed changes
- Provenance model — adds
displayNameKindon the create wire args,displayNameIsPinnedonWorktreeMeta, and a deriveddisplayNameModeonWorktree, replacing the old renderer heuristic that couldn't tell a user label equal to the branch from an auto-derived one. - Name resolution — new
src/main/ipc/worktree-display-name.tscentralizesresolveWorktreeCreateDisplayName/resolveWorktreeCreateDisplayNameMeta, threaded through local, remote, SSH, runtime/RPC, mobile, and CLI create paths. - Renderer branch-change logic —
updateWorktreeGitIdentitynow prefersdisplayNameModeover adisplayName === currentBranchNameequality check, with anundefined-mode fallback that preserves legacy behavior.
ℹ️ CLI and agent worktrees now freeze the sidebar label to --name
src/cli/handlers/worktree.ts now sends displayName: name with displayNameKind: 'user' on every worktree create, so a CLI- or agent-created worktree's label is committed to the --name value and stops re-deriving from the branch on later git checkouts. For the desktop composer this is exactly the intended fix, but the CLI --name is the git branch name itself (there is no separate display label), so this converts a label that previously tracked the branch into a frozen one. Worth confirming this is the intended scope for the CLI and agent paths rather than an accidental broad application of the provenance fix.
Technical details
# CLI/agent display-name provenance scope
## Open questions for the human
- Is it intended that `orca worktree create --name feature` pins the sidebar
label to `feature` so it no longer follows a later branch switch? The composer
wants that; the CLI (and the agent-path tests asserting `displayNameKind:
'user'`) may not. If not, the CLI handler should omit `displayNameKind` (or
mark it `generated`) and let the fallback stay automatic.DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
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:
📝 WalkthroughWalkthroughWorktree creation now carries Merge Risk: 🔵 Low · up to The PR preserves user-set workspace names across branch changes, but two bounded risks remain: clearing a label may leave an empty name for worktrees with no branch, and mixed-version peers may lose the pinned-name distinction in the equal-to-branch case. The change is otherwise mergeable with owner awareness or follow-up for these edge cases. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the bug, behavior, implementation scope, compatibility, and validation. However, it omits the required linked issue, visual proof or an explicit N/A statement, the required Testing section and checklist status, and several template sections. Resolution Add a valid issue reference after “Fixes #”. Add the required Visual Proof section with attachments or write Full details: Docstring CoverageExplanation Docstring coverage is 14.81% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 45 files. (1 skipped: 1 too large.) ✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
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: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b2d8dfa2-e617-4d00-98a8-8ca4ad015fed
📥 Commits
Reviewing files that changed from the base of the PR and between ba5f334 and 486666dff1a13a0602abec13ae4845eba744b484.
📒 Files selected for processing (36)
config/tsconfig.tc.web.jsonmobile/src/tasks/blank-workspace-create.test.tsmobile/src/tasks/blank-workspace-create.tsmobile/src/tasks/source-workspace-create.test.tsmobile/src/tasks/source-workspace-create.tsmobile/src/tasks/workspace-create-params.tssrc/cli/handlers/worktree.tssrc/cli/index-worktree-create-agent.test.tssrc/cli/index-worktree-create-linear.test.tssrc/cli/index-worktree-create-parent.test.tssrc/cli/index-worktree-create-target.test.tssrc/main/ipc/worktree-display-name.tssrc/main/ipc/worktree-logic.test.tssrc/main/ipc/worktree-logic.tssrc/main/ipc/worktree-metadata-merge.tssrc/main/ipc/worktree-remote.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/worktree-create-args.tssrc/main/runtime/rpc/methods/worktree-create-schemas.tssrc/main/runtime/rpc/methods/worktree-schemas.test.tssrc/main/runtime/rpc/methods/worktree.tssrc/renderer/src/hooks/composer-state/full-creation-execution.tssrc/renderer/src/hooks/composer-state/full-submit-preparation.tssrc/renderer/src/hooks/composer-state/quick-creation-execution.tssrc/renderer/src/hooks/composer-state/quick-creation-request.tssrc/renderer/src/hooks/composer-state/quick-submit-preparation.tssrc/renderer/src/lib/pending-worktree-creation.tssrc/renderer/src/lib/worktree-creation-flow-execute.tssrc/renderer/src/store/slices/worktree-meta-update-application.tssrc/renderer/src/store/slices/worktrees-git-identity-branch-title.test.tssrc/renderer/src/store/slices/worktrees/create/worktree-create-payload.tssrc/renderer/src/store/slices/worktrees/metadata/update-worktree-meta.tssrc/renderer/src/store/slices/worktrees/metadata/worktree-git-identity-update.tssrc/shared/worktree/create-types.tssrc/shared/worktree/meta-types.tssrc/shared/worktree/types.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
e1ab971 to
8ad9530
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. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior Pullfrog review, commit f06ac0ba5c addressed the two open inline threads and hardened the sanitize-to-empty edge cases:
- Mobile display-name trimming —
createNewBranchWorkspace/createBranchWorkspacenow send a pre-trimmedmanualDisplayName, resolving the guard-vs-value inconsistency. - Provenance-branch clarity —
resolveWorktreeCreateDisplayNameMetagained comments explaining the generated-vs-user distinction, and the bidi rationale was restored onsanitizeWorktreeDisplayName. - Empty user-label handling — a user label that sanitizes away now resolves to
{ displayNameIsPinned: false }, keeping the generated fallback automatic rather than falling through toshouldSetDisplayName. - Runtime folder path —
createManagedWorktreeresolves the name viaresolveWorktreeCreateDisplayNameand pins only whendisplayNameKind === 'user'with a non-empty resolved name. - Test coverage — new cases cover sanitize-to-empty user labels and the folder path's unpinned behavior; each would fail under the previous logic.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
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: a5456a70-9164-4eca-a08d-f70b847a1421
📥 Commits
Reviewing files that changed from the base of the PR and between f06ac0b and 67d7fd70bc0cad95b59f86fe47bf8cdb24564abf.
📒 Files selected for processing (13)
src/main/ipc/worktree-metadata-merge.test.tssrc/main/ipc/worktree-metadata-merge.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/orchestration-federated-worker-start.tssrc/main/runtime/rpc/methods/orchestration-federation-start-schema.tssrc/main/runtime/rpc/methods/orchestration-federation.test.tssrc/main/runtime/rpc/methods/orchestration-federation.tssrc/main/runtime/rpc/methods/orchestration-worker-topology.tssrc/main/runtime/rpc/methods/orchestration-workers-new-worktree.test.tssrc/renderer/src/store/slices/worktree-meta-update-application.test.tssrc/renderer/src/store/slices/worktree-meta-update-application.tssrc/renderer/src/store/slices/worktrees/listing/detected-worktree-meta.test.tssrc/renderer/src/store/slices/worktrees/listing/detected-worktree-meta.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
There was a problem hiding this comment.
ℹ️ No critical issues — one minor import-ordering nit inline.
Reviewed changes
- Automatic name freshness —
mergeWorktreenow re-derives the display name from the live branch wheneverdisplayNameIsPinnedisfalse, so a persisted auto-generated label no longer shows a stale value after a branch switch. - Clear-label optimistic reset —
applyWorktreeUpdatesandapplyDetectedWorktreeUpdatesreset the display name back to the current branch immediately when a label is cleared, matching the server-side merge. - Orchestration provenance — worker and federation create paths now carry
displayNameKind(a new optional schema field, plus a'user'derivation from an explicit worker label), andcreateManagedWorktreeforwards it. - Coverage — new tests exercise branch re-derivation, the clear-label reset in both projection helpers, and worker-label provenance; each fails under the previous logic.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
| @@ -17,6 +17,7 @@ import { worktreeMatchesHost } from './worktree-host-ownership' | |||
| const folderWorkspaceWorktreeCache = new WeakMap<FolderWorkspace, Worktree>() | |||
|
|
|||
| import { worktreeRowMatchesMetaHost } from './worktree-meta-host-match' | |||
| import { branchName } from '@/lib/git-utils' | |||
There was a problem hiding this comment.
branchName (and worktreeRowMatchesMetaHost above it) is imported after the folderWorkspaceWorktreeCache declaration instead of with the top-level import block, whereas the sibling worktree-meta-update-application.ts imports branchName cleanly at the top. Hoist these two imports to the top of the file to match the surrounding convention.
c29d299 to
8c5a390
Compare
There was a problem hiding this comment.
ℹ️ The
c29d299delta is clean. Holding only on the minor import-placement suggestion left by the prior review (unchanged by this commit).
Reviewed changes
- Legacy CLI label preservation —
mergeWorktreenow treats pre-migration CLI-created labels (cliProvenance.kind === 'created-by-cli'with nodisplayNameIsPinned) as fixed instead of automatic, so a legacy label equal to its branch no longer re-derives on refresh. - Renderer fallback —
updateWorktreeGitIdentityexcludes CLI-created worktrees from the display-name-equals-branch auto-derived heuristic, preserving legacy CLI titles even whendisplayNameModewas never projected (mixed-version / stale-cache defense-in-depth). - Coverage — new tests exercise both the server projection and the renderer fallback; each fails under the previous logic.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in this delta. The one thread left open by the prior review (import placement in
detected-worktree-meta.ts) is unchanged by this commit and remains pending.
Reviewed changes
- Unified CLI provenance resolution — added
resolveWorktreeCreateDisplayNameRequest, which coerces CLI-created requests to a pinned'user'label (falling back toargs.namewhen no display name was sent), and threaded it through the local, SSH, folder-workspace, provisioned-root-adoption, and runtime create paths so the legacy CLI contract holds on every host. - Host-authoritative pinning —
worktrees:updateMetanow derivesdisplayNameIsPinnedfrom the display name at the host boundary instead of trusting renderer-authored provenance, and the first-agent title rename pins its label for catalog-refresh stability. - Concurrent-rename preservation — added
preserveConcurrentDisplayNameso a listing refresh response that predates a completed rename cannot clobber the newer label, covering mode-absent (older host) and mode-projected (newer host) variants. - Detached-worktree fallback —
applyWorktreeUpdatesandapplyDetectedWorktreeUpdateskeep the old label when clearing on a detached worktree instead of flashing an empty row, matching the host's repo/path fallback. - Mobile auto-name propagation — mobile create flows now compute
nameIsAutoManagedfrom the draft vs. the last auto-generated name and suppress or emitdisplayName+displayNameKindaccordingly; the web preload forwardsdisplayNameKind.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in this delta. The one prior minor nit (import placement in
detected-worktree-meta.ts) is unchanged and remains the only open item.
Reviewed changes
- Legacy provenance fallback —
resolveWorktreeCreateDisplayNameRequestnow classifies legacy requests that omitdisplayNameKind: an explicitdisplayNamemaps to a generated artifact title,nameWasGeneratedstays generated, and a bare name-only request maps to a user-pinned label, recovering the pre-provenance "user-typed name" contract. - Threaded
nameWasGenerated— the local, SSH, folder-workspace, provisioned-root, and runtime create paths now passnameWasGeneratedinto the resolver so legacy generated names remain automatic. - Mobile collision-retry authoritative name —
createWorktreeWithNameRetryreturns the host-selected display name after a collision retry, falling back to the client candidate when an older host omits it. - Coverage — new tests pin the legacy name-only user create at the host boundary, the generated-name/artifact-title fallbacks, and the host-display-name-after-retry behavior.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in this delta — the refresh-race fence is sound.
Reviewed changes
Since the prior Pullfrog review (174ca42726), commit da97c36966 ("fence display-name refresh races"):
- Pending-write fence —
persistWorktreeMetanow tracks in-flightdisplayNamepersists in a module-level set, andpreserveConcurrentDisplayNamekeeps the optimistic name whenever a persist is still in flight, so a listing response captured before the write settles can't clobber the newer label. - Older-host guard — when a refresh omits
displayNameModebut the live worktree is pinned (fixedor legacy CLI provenance), the merge keeps the pinned name instead of letting an omitted/generated label replace it. - Coverage — two new tests, each failing under the prior logic: one pins a
fixedmode across a branch switch when the host dropsdisplayNameMode, the other asserts a stale host response never overwrites an in-flight rename.
The one item still open from an earlier review (import placement in detected-worktree-meta.ts) is unchanged by this commit.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
The old-host preserve fence kept a pinned local label on every refresh, which also suppressed a legitimate rename another client persisted through the same host until app restart. Narrow it to labels the host re-derived itself (branch short name, or path basename when detached); any other changed label in a mode-less response is explicit meta a peer wrote there. Stale prior-label responses stay covered by the downstream staleness fence, in-flight writes by the pending fence.
Three call sites (renderer optimistic update, local IPC updateMeta handler, remote worktree.set handler) each restated the same formula; a future edit to one would silently skew provenance between paths.
There was a problem hiding this comment.
ℹ️ No new issues in this delta. The prior import-placement nit in
detected-worktree-meta.tsremains open and is unchanged by this commit.
Reviewed changes
Since the prior Pullfrog review (da97c36966), commit 860e79c212 ("accept peer renames from provenance-less hosts"):
- Narrowed the older-host guard —
preserveConcurrentDisplayNamenow suppresses an incoming label only when it looks automatic (equal to the branch short, or the path basename when detached-HEAD), so a genuine peer rename from a provenance-less host is no longer clobbered by the previous over-broad guard. TheincomingLooksAutomaticcheck mirrors the host's ownmergeWorktreederivation. - Coverage — three new tests cover accepting a peer rename, suppressing a branch-derived relabel, and suppressing a detached-HEAD path relabel; the peer-rename test fails under the previous logic.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…-refactor main advanced 45 commits, six of them landing inside the orca-runtime.ts this branch splits apart. Git resolves that as a plain "take one side", and either side silently loses work, so each was ported into the module that now owns the code: - stablyai#17655 bound ref and worktree scans -> runtime-repository-ref-queries - stablyai#17448 preserve user-set workspace names -> the worktree-create modules - stablyai#17667 cut cold worktree-switch attach latency -> the mutation lock, including the deletion half (worktree-terminal-mutation-wait.ts is gone) - stablyai#17718 preserve large agent prompt pastes -> the agent-prompt write path - stablyai#17486 unblock targeted SSH session tab refresh -> the mobile refresh modules - stablyai#17159 close readiness gaps -> 34 runtime hunks and 5 test hunks Every added line of the six was checked against the merged tree; the unmatched ones are all renames or line splits, verified individually. Two defects surfaced while porting, both predating this merge: - isMobileSessionSurfaceMembershipAllowed read a session accessor that answers null where main's answers undefined, so main's `session !== undefined` guard was always true and the fence stopped fencing. Three clauses found in neither main nor the split base had been added ahead of it to compensate, and one of them dropped a freshly published split leaf out of syncWindowGraph. Restored to main's control flow with the sentinel normalized; stablyai#17159's two new tests cover it from both directions. - retiredMobileSessionPtyIds was write-only state this branch invented. Its only reader was the clause above, and it exists in neither main nor the split base. - RuntimeTerminalWriter.writeAgentPrompt had no callers and still carried the chunked-paste shape stablyai#17718 replaced.
The stablyai#17448 port added a third import from ../ipc/worktree-logic, which the code-quality oxlint config rejects under --deny-warnings. Plain oxlint does not flag it, so it only surfaced in CI's static analysis job.
…17605) * refactor(runtime): split OrcaRuntimeService into focused modules * test(runtime): cover admission tiers and strict worktree reconciliation * fix(runtime): preserve owner and structured session visibility * fix(runtime): port post-extraction compatibility fixes * fix(runtime): preserve skill-share cancellation barrier * test(runtime): update identity inventory after extraction * fix(runtime): preserve hook transport environment cleanup * fix(runtime): consolidate idle probe imports * test(runtime): retire split file process allowlist entry * fix(runtime): route child process types through shared boundary * test(runtime): preserve worktree host metadata precedence * fix(runtime): update extracted test seams * fix(runtime): gate the split's ts-nocheck set and restore the stop-confirmed contract Audit follow-ups for the OrcaRuntimeService split: - Freeze the 171 @ts-nocheck files behind a ratchet so no new file can disable type checking. The split's linear mixin chain cannot express forward references yet, so the existing suppressions are grandfathered; the baseline may only shrink. - Drop the stray @ts-nocheck at the end of orca-runtime-get-status.ts. It sat after the first statement, where TypeScript ignores it, so the module was already checked. - Restore `retireRejectedPty(ptyId, stopConfirmed: boolean)` as a required argument. The split widened it to optional and patched the resulting error with `stopConfirmed === true`; an omitted argument would have silently taken the unverified-stop path instead of failing to compile. - Guard that every orca-runtime-tests fragment is imported by the compatibility entrypoint. The fragments are .spec.ts, which no Vitest include glob matches, so one left out of the list would silently stop running. * fix(runtime): restore four behaviors the OrcaRuntimeService split dropped Audit findings against the refactor's true base (ad5ba25): - retirePtyAgentLaunchAuthority collected pane keys after deleting the restored-authority receipt instead of before it. collectPaneKeysForPty reads that receipt, so a receipt-only pane lost its key and never had its agent-hook compatibility authority retired. on-pty-exit.ts already carried a comment naming this exact invariant. - The PTY-exit path kept orchestrationMailboxNotifications.retirePty but lost the loop that schedules a debounced mail-pointer repoint for the dead pty's terminal handle and any run bound to its panes. Restores the schedule call count to 7, matching base. - subscribeToPtyExit lost isPtyKnownExited's leaf fallback and its post-registration lifecycle-generation recheck. leavesByPtyId is rebuilt from the renderer graph independently of ptysById, so a leaf can outlive its pty record; without the fallback a caller waiting on an already-dead pty never gets released. - The chain root declared `[key: string]: unknown`, which base had nowhere. It leaked through the exported runtime type into every consumer, so any misspelled member access typechecked as unknown instead of erroring, and it accounted for 957 of the suppressed errors. Removing it costs zero type errors. * fix(runtime): restore escalation prose and unscoped automation publication Two more behaviors the split dropped, each with a regression test that fails against the pre-fix code: - The worker-exit escalation stopped deriving its title through buildOrchestrationTaskDisplayMetadata and inlined `task.spec` instead. That ignored an explicit task_title, dropped the single-line normalization and the 80-character bound, and turned the no-spec case into a quoted, duplicated id. A multi-paragraph spec landed verbatim in the coordinator's banner. The existing 11 tests all use short single-line specs, where the derived title and the raw spec are identical, so none of them could see it. Also reverts an added `if (!handle) return` guard: the dispatch lookup is deliberately keyed on the pane as well, because a reminted handle no longer matches the row while the pane identity outlives the remint. - updateAutomation stopped going through automationChangePublications and published `source` unconditionally while gating the fallback on a non-null destination. A destination the store can no longer name then published only the stale source, so subscribers scoped elsewhere kept rendering a row that had left them — the exact case the helper documents. The helper had been left with zero callers; all three sites use it again. * fix(skills): stop swallowing lookup errors and hard-erroring on non-ssh hosts Follow-ups from auditing the skill install path against the refactor's base: - resolveWorktree wrapped showManagedWorktree in `.catch(() => null)`, so a transient git or IO failure surfaced to the user as skill-install-workspace-not-found with the real cause discarded. Errors propagate again; a genuine id mismatch still returns null. - resolveSkillSshTarget threw skill-install-workspace-host-unavailable when the execution host was neither local nor ssh, on both the repo and folder branches. Base gated these on connectionId, so a runtime-owned repo simply was not an SSH install and fell through to the local path. Both return null again, and the error code the split invented is now unreferenced. - listManagedSkillInstalls awaited the receipt walk and the worktree resolve in sequence. They are independent and either can hit disk, WSL, or an SSH scan, so Promise.all is restored. Deliberately unchanged: resolving the worktree through listResolvedWorktrees rather than showManagedWorktree, which disambiguates a worktree id colliding across hosts and is covered by its own test, and the SSH-folder skill-install-ssh-dispatch-required throw, which matches the repo branch. * fix(runtime): merge duplicate worktree-logic imports The #17448 port added a third import from ../ipc/worktree-logic, which the code-quality oxlint config rejects under --deny-warnings. Plain oxlint does not flag it, so it only surfaced in CI's static analysis job. * ci: run the ts-nocheck ratchet in PR checks pr-workflow-lint-parity requires every leaf command in `pnpm lint` to have a matching step in pr.yml. The ratchet was wired into lint but not the workflow, so PR CI would not have enforced it. * Merge remote-tracking branch 'origin/main' and retry the paired-host launch evaluate main advanced 9 commits; none touch the orca-runtime.ts this branch splits, so nothing needed porting. CI failed twice on `Execution context was destroyed` thrown from headless-paired-runtime-host's first `evaluate` after launch — a different spec each run, which is the signature of the flake #17780 describes rather than a regression. That commit added retryTransientMainEvaluate and adopted it in five helpers but not this call site, even though its docblock names exactly this case: the first evaluate after electron.launch() resolves, before the app is ready. Wrapped it the same way.
* fix(worktrees): preserve user workspace names across branch changes * test(worktrees): cover pinned rename metadata * fix(workspaces): address display-name review edge cases * fix(workspaces): keep automatic names fresh across refreshes * fix(workspaces): preserve legacy CLI labels * fix(workspaces): preserve display-name provenance across hosts * fix(workspaces): honor legacy display-name provenance * fix(workspaces): fence display-name refresh races * fix(workspaces): accept peer renames from provenance-less hosts The old-host preserve fence kept a pinned local label on every refresh, which also suppressed a legitimate rename another client persisted through the same host until app restart. Narrow it to labels the host re-derived itself (branch short name, or path basename when detached); any other changed label in a mode-less response is explicit meta a peer wrote there. Stale prior-label responses stay covered by the downstream staleness fence, in-flight writes by the pending fence. * refactor(workspaces): unify display-name pin derivation Three call sites (renderer optimistic update, local IPC updateMeta handler, remote worktree.set handler) each restated the same formula; a future edit to one would silently skew provenance between paths.
…tablyai#17605) * refactor(runtime): split OrcaRuntimeService into focused modules * test(runtime): cover admission tiers and strict worktree reconciliation * fix(runtime): preserve owner and structured session visibility * fix(runtime): port post-extraction compatibility fixes * fix(runtime): preserve skill-share cancellation barrier * test(runtime): update identity inventory after extraction * fix(runtime): preserve hook transport environment cleanup * fix(runtime): consolidate idle probe imports * test(runtime): retire split file process allowlist entry * fix(runtime): route child process types through shared boundary * test(runtime): preserve worktree host metadata precedence * fix(runtime): update extracted test seams * fix(runtime): gate the split's ts-nocheck set and restore the stop-confirmed contract Audit follow-ups for the OrcaRuntimeService split: - Freeze the 171 @ts-nocheck files behind a ratchet so no new file can disable type checking. The split's linear mixin chain cannot express forward references yet, so the existing suppressions are grandfathered; the baseline may only shrink. - Drop the stray @ts-nocheck at the end of orca-runtime-get-status.ts. It sat after the first statement, where TypeScript ignores it, so the module was already checked. - Restore `retireRejectedPty(ptyId, stopConfirmed: boolean)` as a required argument. The split widened it to optional and patched the resulting error with `stopConfirmed === true`; an omitted argument would have silently taken the unverified-stop path instead of failing to compile. - Guard that every orca-runtime-tests fragment is imported by the compatibility entrypoint. The fragments are .spec.ts, which no Vitest include glob matches, so one left out of the list would silently stop running. * fix(runtime): restore four behaviors the OrcaRuntimeService split dropped Audit findings against the refactor's true base (9dd3804): - retirePtyAgentLaunchAuthority collected pane keys after deleting the restored-authority receipt instead of before it. collectPaneKeysForPty reads that receipt, so a receipt-only pane lost its key and never had its agent-hook compatibility authority retired. on-pty-exit.ts already carried a comment naming this exact invariant. - The PTY-exit path kept orchestrationMailboxNotifications.retirePty but lost the loop that schedules a debounced mail-pointer repoint for the dead pty's terminal handle and any run bound to its panes. Restores the schedule call count to 7, matching base. - subscribeToPtyExit lost isPtyKnownExited's leaf fallback and its post-registration lifecycle-generation recheck. leavesByPtyId is rebuilt from the renderer graph independently of ptysById, so a leaf can outlive its pty record; without the fallback a caller waiting on an already-dead pty never gets released. - The chain root declared `[key: string]: unknown`, which base had nowhere. It leaked through the exported runtime type into every consumer, so any misspelled member access typechecked as unknown instead of erroring, and it accounted for 957 of the suppressed errors. Removing it costs zero type errors. * fix(runtime): restore escalation prose and unscoped automation publication Two more behaviors the split dropped, each with a regression test that fails against the pre-fix code: - The worker-exit escalation stopped deriving its title through buildOrchestrationTaskDisplayMetadata and inlined `task.spec` instead. That ignored an explicit task_title, dropped the single-line normalization and the 80-character bound, and turned the no-spec case into a quoted, duplicated id. A multi-paragraph spec landed verbatim in the coordinator's banner. The existing 11 tests all use short single-line specs, where the derived title and the raw spec are identical, so none of them could see it. Also reverts an added `if (!handle) return` guard: the dispatch lookup is deliberately keyed on the pane as well, because a reminted handle no longer matches the row while the pane identity outlives the remint. - updateAutomation stopped going through automationChangePublications and published `source` unconditionally while gating the fallback on a non-null destination. A destination the store can no longer name then published only the stale source, so subscribers scoped elsewhere kept rendering a row that had left them — the exact case the helper documents. The helper had been left with zero callers; all three sites use it again. * fix(skills): stop swallowing lookup errors and hard-erroring on non-ssh hosts Follow-ups from auditing the skill install path against the refactor's base: - resolveWorktree wrapped showManagedWorktree in `.catch(() => null)`, so a transient git or IO failure surfaced to the user as skill-install-workspace-not-found with the real cause discarded. Errors propagate again; a genuine id mismatch still returns null. - resolveSkillSshTarget threw skill-install-workspace-host-unavailable when the execution host was neither local nor ssh, on both the repo and folder branches. Base gated these on connectionId, so a runtime-owned repo simply was not an SSH install and fell through to the local path. Both return null again, and the error code the split invented is now unreferenced. - listManagedSkillInstalls awaited the receipt walk and the worktree resolve in sequence. They are independent and either can hit disk, WSL, or an SSH scan, so Promise.all is restored. Deliberately unchanged: resolving the worktree through listResolvedWorktrees rather than showManagedWorktree, which disambiguates a worktree id colliding across hosts and is covered by its own test, and the SSH-folder skill-install-ssh-dispatch-required throw, which matches the repo branch. * fix(runtime): merge duplicate worktree-logic imports The stablyai#17448 port added a third import from ../ipc/worktree-logic, which the code-quality oxlint config rejects under --deny-warnings. Plain oxlint does not flag it, so it only surfaced in CI's static analysis job. * ci: run the ts-nocheck ratchet in PR checks pr-workflow-lint-parity requires every leaf command in `pnpm lint` to have a matching step in pr.yml. The ratchet was wired into lint but not the workflow, so PR CI would not have enforced it. * Merge remote-tracking branch 'origin/main' and retry the paired-host launch evaluate main advanced 9 commits; none touch the orca-runtime.ts this branch splits, so nothing needed porting. CI failed twice on `Execution context was destroyed` thrown from headless-paired-runtime-host's first `evaluate` after launch — a different spec each run, which is the signature of the flake stablyai#17780 describes rather than a regression. That commit added retryTransientMainEvaluate and adopted it in five helpers but not this call site, even though its docblock names exactly this case: the first evaluate after electron.launch() resolves, before the app is ready. Wrapped it the same way.

Summary
Fixes the P0 workspace unwanted-renaming bug by persisting whether a display name is user-pinned or automatic. User labels survive branch changes, including when the label equals the old branch; generated branch-like labels remain automatic.
Reproduction
On origin/main, a workspace with branch
featureand display namefeaturechanges its sidebar label tomainafter switching branches. The old renderer heuristic could not distinguish a user label from an auto-derived label.Behavior
Validation
pnpm tcCompatibility note
An old host/client cannot preserve the equal-to-branch edge case after refresh because it does not persist/project the optional provenance bit; updated peers do. No public comments, deployment, or Linear mutation was performed.
ELI5
Orca now records whether a sidebar label came from the user or was generated from Git. A user label stays put when the branch changes, while generated labels continue following the branch. The provenance travels through local, remote, CLI, and mobile creation paths, and older metadata falls back to the previous heuristic.
Performance Measurement
No speed-up is claimed or measured; this is metadata correctness. Branch-switch handling remains O(1) and adds only a boolean provenance check; create and update paths add at most one optional enum/boolean field. Existing Git probes, IPC/RPC round trips, and persistence counts are unchanged. No wall-clock benchmark was run.
User-Facing Trade-offs
None on updated peers: user labels stay pinned while generated labels continue to follow the branch. A mixed-version old host or client cannot preserve the equal-to-branch pinned-label edge case because it does not carry the optional provenance bit; updated peers do. Otherwise label and branch behavior is unchanged.