From 9830ee7d95d0865e188cd2c2fbf7af4e731f11c3 Mon Sep 17 00:00:00 2001 From: Merge Sim Date: Fri, 11 Sep 2026 10:41:32 -0700 Subject: [PATCH] test: align trust preflight coverage with shared launcher --- ...rktree-creation-flow-agent-trust-preflight.test.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/renderer/src/lib/worktree-creation-flow-agent-trust-preflight.test.ts b/src/renderer/src/lib/worktree-creation-flow-agent-trust-preflight.test.ts index 909348d7f6a..e18f1104601 100644 --- a/src/renderer/src/lib/worktree-creation-flow-agent-trust-preflight.test.ts +++ b/src/renderer/src/lib/worktree-creation-flow-agent-trust-preflight.test.ts @@ -4,10 +4,7 @@ import { describe, expect, it } from 'vitest' const FLOW_SOURCE = readFileSync(join(__dirname, 'worktree-creation-flow-execute.ts'), 'utf8') const PREFLIGHT_SOURCE = readFileSync(join(__dirname, 'agent-trust-preflight.ts'), 'utf8') -const STRUCTURED_SOURCE = readFileSync( - join(__dirname, 'worktree-creation-structured-session.ts'), - 'utf8' -) +const LAUNCHER_SOURCE = readFileSync(join(__dirname, 'launch-agent-session-terminal.ts'), 'utf8') function sourceBetween(source: string, startPattern: string, endPattern: string): string { const start = source.indexOf(startPattern) @@ -32,7 +29,9 @@ describe('worktree creation flow agent trust preflight', () => { expect(createFlow).toContain('repo.id === worktree.repoId') expect(createFlow).toContain('await preflightAgentTrust({') expect(createFlow).toContain('connectionId: repoConnectionId') - expect(STRUCTURED_SOURCE).toContain('await preflightAgentTrust({') - expect(STRUCTURED_SOURCE).toContain('workspacePath: worktree.path') + // Structured creation now delegates terminal fallback trust to the shared launcher rather + // than carrying a second preflight in the caller. + expect(LAUNCHER_SOURCE).toContain('await preflightAgentTrust({') + expect(LAUNCHER_SOURCE).toContain('workspacePath: worktree?.path') }) })