Repository navigation
[codex] Preserve local worktree terminal state - #1582
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR extends git worktree support across the full stack: the executor gains path-based and ChangesWorktree identity, workspace target routing, and per-task terminal UI
Sequence Diagram(s)sequenceDiagram
participant Executor
participant localServices
participant WorkbenchProvider
participant DesktopWorkbenchLayout
participant DesktopWorkbenchMain
participant BottomWorkspacePanel
participant WorkspacePanelCards
Executor->>localServices: runtime.tasks.list (workspace_path, workspace_kind: worktree, worktree_id)
localServices->>WorkbenchProvider: normalizeRuntimeTaskSummaries → LocalTaskSummary (workspacePath, worktreeId)
WorkbenchProvider->>WorkbenchProvider: getRuntimeTaskRouteKey(deviceId, localTaskId, workspacePath)
WorkbenchProvider->>DesktopWorkbenchLayout: runtimeTaskTarget with workspacePath
DesktopWorkbenchLayout->>DesktopWorkbenchLayout: resolveProjectRuntimeWorkspaceTarget → activeWorkspaceTarget
DesktopWorkbenchLayout->>DesktopWorkbenchMain: workspaceProject + activeWorkspaceTarget
DesktopWorkbenchMain->>DesktopWorkbenchMain: bottomPanelWorkspaceKey (deviceId + localTaskId + workspacePath)
DesktopWorkbenchMain->>BottomWorkspacePanel: active=true, preserveContent, preferLocalTerminal
BottomWorkspacePanel->>WorkspacePanelCards: defaultOpenTool=terminal, hideTerminalChrome, panelActive
WorkspacePanelCards->>WorkspacePanelCards: canUseLocalTerminalCheck → startLocalTerminal(cwd=workspacePath)
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
11f7443 to
33d7770
Compare
Summary
$HOME.runtime.tasks.listgroups Codex worktrees under the project root while each LocalTask keeps its real worktree path,workspaceKind: worktree, andworktreeId.Root Cause
The executor response builder was overwriting each LocalTask
workspacePathwith the parent workspace group path. As a result, the Wework sidebar received task records as regular workspaces instead of worktrees, so the worktree icon and terminal cwd could not be restored correctly.Conflict Resolution
Rebased onto latest
mainand kept the pinned runtime task behavior frommainwhile preserving task address matching byworkspacePathfrom this branch.Validation
cargo test -p wegent-executor --test app_runtime_work_workspace_contractcargo test -p wegent-executor runtime_workcargo test -p wegent-executor --all-features --test turn_file_changes_contractpnpm --dir wework exec tsc --noEmitpnpm --dir wework lintpnpm --dir wework exec vitest run src/api/local/localServices.test.ts src/components/layout/DesktopSidebar.test.tsx src/features/workbench/WorkbenchProvider.test.tsx src/components/layout/DesktopWorkbenchLayout.test.tsx src/components/layout/MobileWorkbenchLayout.test.tsx src/components/layout/workspace-panels/WorkspacePanelCards.test.tsx src/lib/workspace-target.test.ts src/lib/device-capabilities.test.ts src/lib/navigation.test.tscargo fmt --check,cargo test --all-features, andcargo clippyall passed.Summary by CodeRabbit
New Features
Bug Fixes