mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 21:04:23 +01:00
feat(walkthrough): open the change walkthrough from an agent tool call
This commit is contained in:
1 parent
3eb0b02203
commit
aa1da8d608
26 files changed
+1367
-175
No files matched your search
@@ -1,15 +1,17 @@
|
||||
import { vi } from 'vitest'
|
||||
import type { OpenCodeApi } from '@opencode-manager/shared/opencode'
|
||||
import type { ModelInfo, OpenCodeApi } from '@opencode-manager/shared/opencode'
|
||||
import type { OpenCodeClient } from '../../src/services/opencode/client'
|
||||
|
||||
/** OpenCode API stubs for a catalog that has finished loading, so model resolution succeeds on the first poll. */
|
||||
export function stubLoadedModelCatalog() {
|
||||
const model = { providerID: 'openai', id: 'gpt-5-mini', enabled: true }
|
||||
export function stubLoadedModelCatalog(models: ModelInfo[] = [
|
||||
{ providerID: 'openai', id: 'gpt-5-mini', enabled: true } as ModelInfo,
|
||||
]) {
|
||||
const defaultModel = models[0] ?? null
|
||||
return {
|
||||
config: { get: vi.fn(async () => []) },
|
||||
model: {
|
||||
list: vi.fn(async () => ({ data: [model] })),
|
||||
default: vi.fn(async () => ({ data: model })),
|
||||
list: vi.fn(async () => ({ data: models })),
|
||||
default: vi.fn(async () => ({ data: defaultModel })),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user