Skip to content

feat(git): track active agent and subagent CWD for worktree branch isolation (#7) - #20

Open
facyndev wants to merge 3 commits into
developfrom
feat/git-worktree-branch-tracking
Open

facyndev wants to merge 3 commits into
developfrom
feat/git-worktree-branch-tracking

Conversation

@facyndev

Copy link
Copy Markdown
Owner

Summary

  • Use ProcessRefreshKind::nothing().with_cmd(UpdateKind::OnlyIfNotSet).with_cwd(UpdateKind::Always) in SysinfoProcessInspector to capture process working directories.
  • Store cwd: Option on ProcessInfo and resolve �ctive_cwd on AgentTree by inspecting the agent subtree (giving precedence to subagent/tool processes operating in worktree paths).
  • Forward cwd in the erminal-agent Tauri payload and bind it in TerminalPane to effectiveCwd = agentCwd ?? cwd.
  • useGitBranch, CwdSwitcher, and NewTerminalMenu in the pane header now evaluate against effectiveCwd, dynamically isolating and tracking the Git branch when agents and subagents operate in dedicated Git worktrees.

Closes #7

Verification

  • cargo test -p application reports_active_cwd_of_primary_agent_and_prefers_subagent_worktree_cwd (passed)
  • cargo test -p infrastructure sees_the_current_process_and_its_parent (passed)
  • pnpm --filter @opencollab/desktop test (passed)
  • pnpm --filter @opencollab/desktop build (passed)
  • cargo clippy --workspace --all-targets -- -D warnings (passed)
  • cargo test -p desktop (passed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant