mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
fix(assistant): correct session endpoint path and add ordering params
This commit is contained in:
1 parent
4cfe692bd2
commit
4de0f05fee
2 files changed
+3
-3
No files matched your search
@@ -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),
|
||||
})
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user