From 4de0f05fee4bdcc4350b2ede3d47972c8814797e Mon Sep 17 00:00:00 2001 From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com> Date: Sat, 6 Jun 2026 00:31:46 -0400 Subject: [PATCH] fix(assistant): correct session endpoint path and add ordering params --- backend/src/services/assistant-mode.ts | 2 +- backend/test/services/assistant-mode.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/services/assistant-mode.ts b/backend/src/services/assistant-mode.ts index 3052e02c..ca562592 100644 --- a/backend/src/services/assistant-mode.ts +++ b/backend/src/services/assistant-mode.ts @@ -1090,7 +1090,7 @@ export async function warmAssistantWorkspace(deps: { db: deps.db, apiBaseUrl: deps.apiBaseUrl, }) - await deps.openCodeClient.getJson('/session', { + await deps.openCodeClient.getJson('/api/session?limit=1&order=desc', { directory: status.directory, signal: AbortSignal.timeout(ASSISTANT_WARMUP_OPENCODE_TIMEOUT_MS), }) diff --git a/backend/test/services/assistant-mode.test.ts b/backend/test/services/assistant-mode.test.ts index a35c7b24..08266773 100644 --- a/backend/test/services/assistant-mode.test.ts +++ b/backend/test/services/assistant-mode.test.ts @@ -620,7 +620,7 @@ describe('warmAssistantWorkspace', () => { }) afterEach(async () => { await ws.cleanup() }) - it('provisions the workspace and triggers a directory-scoped session request', async () => { + it('provisions the workspace and triggers a bounded directory-scoped session request', async () => { const getJsonCalls: Array<{ path: string; directory?: string }> = [] const client = { getJson: async (requestPath: string, opts?: { directory?: string }) => { @@ -634,7 +634,7 @@ describe('warmAssistantWorkspace', () => { const opencodeJson = await readFile(path.join(ws.assistantDir, 'opencode.json'), 'utf8') expect(JSON.parse(opencodeJson).default_agent).toBe('assistant') expect(getJsonCalls).toHaveLength(1) - expect(getJsonCalls[0]?.path).toBe('/session') + expect(getJsonCalls[0]?.path).toBe('/api/session?limit=1&order=desc') expect(getJsonCalls[0]?.directory).toBe(ws.assistantDir) })