From 7e3911d88046d88a4e22ab5d1ca5d8b9eececa86 Mon Sep 17 00:00:00 2001 From: Merge Sim Date: Wed, 9 Sep 2026 00:57:03 -0700 Subject: [PATCH] test(native-chat): pin the two adopters of a planned launch verdict --- .../agent-launch-routing-caller-census.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/renderer/src/lib/agent-launch-routing-caller-census.test.ts b/src/renderer/src/lib/agent-launch-routing-caller-census.test.ts index a552cbcd834..40857e8a55d 100644 --- a/src/renderer/src/lib/agent-launch-routing-caller-census.test.ts +++ b/src/renderer/src/lib/agent-launch-routing-caller-census.test.ts @@ -25,6 +25,12 @@ const LAUNCH_AGENT_IN_NEW_TAB_CALLERS = [ const ROUTE_RESOLVER_DEFINITION = 'src/renderer/src/lib/agent-launch-routing.ts' const ROUTE_PLANNER = 'src/renderer/src/lib/agent-session-launch-plan.ts' const DIRECT_ROUTE_RESOLVER_CALL = /\b(?:resolveAgentLaunchRoute|structuredAgentLaunchSupported)\(/ +// Why: adopting a verdict bypasses the resolver by design (a persisted quick-create request, a +// resume whose gate already planned), so each adopter is pinned rather than trusted by convention. +const VERDICT_ADOPTERS = [ + 'src/renderer/src/components/right-sidebar/ai-vault-session-resume-in-chat-launch.ts', + 'src/renderer/src/lib/worktree-creation-structured-session.ts' +] async function productionFiles(): Promise { return glob(['src/**/*.ts', 'src/**/*.tsx'], { @@ -54,6 +60,16 @@ describe('agent launch routing caller census', () => { expect(directCallers).toEqual([ROUTE_PLANNER]) }) + it('pins every production adopter of a planned verdict', async () => { + const adopters = (await productionFiles()) + .filter((file) => file !== ROUTE_PLANNER) + .filter((file) => + readFileSync(join(REPO_ROOT, file), 'utf8').includes('adoptAgentSessionLaunchVerdict(') + ) + .sort() + expect(adopters).toEqual([...VERDICT_ADOPTERS].sort()) + }) + it('keeps non-visible, resume, and floating launchers intentionally outside the route', () => { for (const file of [ 'src/renderer/src/lib/launch-agent-background-session.ts',