From 22c35973b160ef3dc9b8262a7f02f70d51ac07a3 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Thu, 2 Apr 2026 20:04:16 -0700 Subject: [PATCH] test: update sidebar tests for model router + longer stopAgent slice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - stopAgent slice 800→1000 to accommodate added error logging lines - Replace hardcoded opus assertion with model router assertions Co-Authored-By: Claude Opus 4.6 (1M context) --- browse/test/sidebar-ux.test.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/browse/test/sidebar-ux.test.ts b/browse/test/sidebar-ux.test.ts index 81b67454..05b4fc7c 100644 --- a/browse/test/sidebar-ux.test.ts +++ b/browse/test/sidebar-ux.test.ts @@ -296,7 +296,7 @@ describe('TTFO latency chain', () => { test('stopAgent also calls stopFastPoll', () => { const stopFn = js.slice( js.indexOf('async function stopAgent()'), - js.indexOf('async function stopAgent()') + 800, + js.indexOf('async function stopAgent()') + 1000, ); expect(stopFn).toContain('stopFastPoll'); }); @@ -989,12 +989,17 @@ describe('sidebar agent conciseness + no focus stealing', () => { expect(promptSection).toContain('Do NOT keep exploring'); }); - test('sidebar agent uses opus (not sonnet) for prompt injection resistance', () => { + test('sidebar agent auto-routes model based on message type', () => { + // Model router exists and defaults to opus for analysis tasks + expect(serverSrc).toContain('function pickSidebarModel('); + expect(serverSrc).toContain("return 'opus'"); + expect(serverSrc).toContain("return 'sonnet'"); + // spawnClaude uses the router, not a hardcoded model const spawnFn = serverSrc.slice( serverSrc.indexOf('function spawnClaude('), serverSrc.indexOf('\nfunction ', serverSrc.indexOf('function spawnClaude(') + 1), ); - expect(spawnFn).toContain("'opus'"); + expect(spawnFn).toContain('pickSidebarModel(userMessage)'); }); test('switchTab has bringToFront option', () => {