fix(assistant): correct session endpoint path and add ordering params

This commit is contained in:
Chris Scott committed 2026-06-06 00:31:46 -04:00
1 parent 4cfe692bd2
commit 4de0f05fee
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -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),
})
+2 -2
View File
@@ -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)
})