mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
* fix(server): deduplicate workspaces by resolving to git worktree root Agents running in subdirectories of the same git repo were creating separate workspace entries in the sidebar. Now workspace IDs resolve to the git worktree root (via the already-computed `worktreeRoot` from `inspectCheckoutContext`), so all agents in the same checkout share a single workspace. Stale subdirectory workspace records are archived during reconciliation. * fix(server): fix 3 broken test files in server unit suite - relay-reconnect: move speech mock to correct constructor position and rename getSpeechReadiness→getReadiness after SpeechService refactor - commands-poc: add credential/CLI availability guards matching claude-agent.integration.test.ts pattern - claude-sdk-behavior: pass pathToClaudeCodeExecutable via findExecutable and add credential guards matching real provider configuration * fix(server): fix race condition in loop-service test mock Replace setTimeout(..., 0) with queueMicrotask() in ScriptedAgentSession so turn_completed events fire before the verify check runs. Fixes flaky CI failure where the file write hadn't completed before verification. * fix(server): use /bin/sh for loop verify checks instead of /bin/zsh More portable across CI environments. Also use queueMicrotask in test mock to fix race condition between event emission and waiter setup. * fix(server): correct import paths for isCommandAvailable and findExecutable Import from utils/executable.js (where they're exported) instead of provider-launch-config.js (which only imports them internally).
34 lines
1010 B
TypeScript
34 lines
1010 B
TypeScript
import type { ProjectPlacementPayload } from "@server/shared/messages";
|
|
import { deriveProjectKey, deriveProjectName } from "@/utils/agent-grouping";
|
|
|
|
function normalizeWorkingDirectory(cwd: string): string {
|
|
const trimmed = cwd.trim();
|
|
return trimmed.length > 0 ? trimmed : ".";
|
|
}
|
|
|
|
export function deriveProjectPlacementFromCwd(cwd: string): ProjectPlacementPayload {
|
|
const normalizedCwd = normalizeWorkingDirectory(cwd);
|
|
const projectKey = deriveProjectKey(normalizedCwd);
|
|
|
|
return {
|
|
projectKey,
|
|
projectName: deriveProjectName(projectKey),
|
|
checkout: {
|
|
cwd: normalizedCwd,
|
|
isGit: false,
|
|
currentBranch: null,
|
|
remoteUrl: null,
|
|
worktreeRoot: null,
|
|
isPaseoOwnedWorktree: false,
|
|
mainRepoRoot: null,
|
|
},
|
|
};
|
|
}
|
|
|
|
export function resolveProjectPlacement(input: {
|
|
projectPlacement: ProjectPlacementPayload | null | undefined;
|
|
cwd: string;
|
|
}): ProjectPlacementPayload {
|
|
return input.projectPlacement ?? deriveProjectPlacementFromCwd(input.cwd);
|
|
}
|