Fix 8 failing Playwright e2e tests after SQLite removal

- Delete workspace-hover-card.spec.ts (tests expected unimplemented script UI)
- Fix archive-tab helper to handle idle agents archived without modal
- Add waitForWorkspaceInSidebar helper for hydration timing
- Fix launcher-tab draft counting race with expect.poll waits
- Increase terminal-perf navigation timeouts for CI
- Spawn workspace scripts after worktree setup completes
This commit is contained in:
Mohamed Boudra
2026-04-14 09:37:45 +07:00
parent 369b46ea08
commit 19585709d5
8 changed files with 88 additions and 221 deletions
+7
View File
@@ -6704,6 +6704,13 @@ export class Session {
sessionLogger: this.sessionLogger,
terminalManager: this.terminalManager,
archiveWorkspaceRecord: (workspaceId) => this.archiveWorkspaceRecord(workspaceId),
scriptRouteStore: this.scriptRouteStore,
scriptRuntimeStore: this.scriptRuntimeStore,
getDaemonTcpPort: this.getDaemonTcpPort,
getDaemonTcpHost: this.getDaemonTcpHost,
onScriptsChanged: (workspaceDirectory) => {
this.emitWorkspaceScriptStatusUpdate(workspaceDirectory);
},
},
options,
);
@@ -28,8 +28,11 @@ import {
createAgentWorktree,
createWorktreeSetupProgressAccumulator,
getWorktreeSetupProgressResults,
spawnWorktreeScripts,
} from "./worktree-bootstrap.js";
import type { TerminalManager } from "../terminal/terminal-manager.js";
import type { ScriptRouteStore } from "./script-proxy.js";
import type { WorkspaceScriptRuntimeStore } from "./workspace-script-runtime-store.js";
import { getCheckoutStatusLite, resolveRepositoryDefaultBranch } from "../utils/checkout-git.js";
import { expandTilde } from "../utils/path.js";
import {
@@ -103,6 +106,11 @@ type CreatePaseoWorktreeInBackgroundDependencies = {
sessionLogger: Logger;
terminalManager: TerminalManager | null;
archiveWorkspaceRecord: (workspaceId: string) => Promise<void>;
scriptRouteStore: ScriptRouteStore | null;
scriptRuntimeStore: WorkspaceScriptRuntimeStore | null;
getDaemonTcpPort: (() => number | null) | null;
getDaemonTcpHost: (() => string | null) | null;
onScriptsChanged: ((workspaceDirectory: string) => void) | null;
};
type HandleWorkspaceSetupStatusRequestDependencies = {
@@ -828,6 +836,28 @@ export async function runWorktreeSetupInBackground(
emitSetupProgress("completed", null);
}
}
if (
options.shouldBootstrap &&
dependencies.terminalManager &&
dependencies.scriptRouteStore &&
dependencies.scriptRuntimeStore
) {
await spawnWorktreeScripts({
repoRoot: worktree.worktreePath,
workspaceId: worktree.worktreePath,
branchName: worktree.branchName,
daemonPort: dependencies.getDaemonTcpPort?.() ?? null,
daemonListenHost: dependencies.getDaemonTcpHost?.() ?? null,
routeStore: dependencies.scriptRouteStore,
runtimeStore: dependencies.scriptRuntimeStore,
terminalManager: dependencies.terminalManager,
logger: dependencies.sessionLogger,
onLifecycleChanged: () => {
dependencies.onScriptsChanged?.(worktree.worktreePath);
},
});
}
} catch (error) {
if (error instanceof WorktreeSetupError) {
setupResults = error.results;