fix: use mainRepoRoot for agent creation in Paseo-owned worktrees

This commit is contained in:
Mohamed Boudra
2026-01-31 12:04:32 +07:00
parent ea33d1980f
commit c57c86286a
7 changed files with 74 additions and 7 deletions
@@ -121,14 +121,17 @@ function SectionHeader({
}
}
const createAgentWorkingDir =
(checkout?.isPaseoOwnedWorktree ? checkout.mainRepoRoot : null) ?? section.workingDir;
const handleCreatePress = useCallback(
(e: { stopPropagation: () => void }) => {
e.stopPropagation();
if (section.workingDir) {
onCreateAgent(section.workingDir);
if (createAgentWorkingDir) {
onCreateAgent(createAgentWorkingDir);
}
},
[onCreateAgent, section.workingDir]
[onCreateAgent, createAgentWorkingDir]
);
return (
@@ -171,7 +174,7 @@ function SectionHeader({
</Text>
</View>
<View style={styles.sectionHeaderRight}>
{section.workingDir && (
{createAgentWorkingDir && (
<Pressable
style={styles.createAgentButton}
onPress={handleCreatePress}