diff --git a/packages/app/e2e/fixtures.ts b/packages/app/e2e/fixtures.ts index a24602982d..fe2eb9c1a0 100644 --- a/packages/app/e2e/fixtures.ts +++ b/packages/app/e2e/fixtures.ts @@ -56,6 +56,19 @@ type LLMWorker = LLMFixture & { reset: () => Promise } +type AssistantFixture = { + reply: LLMFixture["text"] + tool: LLMFixture["tool"] + toolHang: LLMFixture["toolHang"] + reason: LLMFixture["reason"] + fail: LLMFixture["fail"] + error: LLMFixture["error"] + hang: LLMFixture["hang"] + hold: LLMFixture["hold"] + calls: LLMFixture["calls"] + pending: LLMFixture["pending"] +} + export const settingsKey = "settings.v3" const seedModel = (() => { @@ -127,6 +140,7 @@ type ProjectFixture = ProjectHandle & { type TestFixtures = { llm: LLMFixture + assistant: AssistantFixture project: ProjectFixture sdk: ReturnType gotoSession: (sessionID?: string) => Promise @@ -218,6 +232,20 @@ export const test = base.extend({ throw new Error(`TestLLMServer still has ${pending} queued response(s) after the test finished`) } }, + assistant: async ({ llm }, use) => { + await use({ + reply: llm.text, + tool: llm.tool, + toolHang: llm.toolHang, + reason: llm.reason, + fail: llm.fail, + error: llm.error, + hang: llm.hang, + hold: llm.hold, + calls: llm.calls, + pending: llm.pending, + }) + }, page: async ({ page }, use) => { let boundary: string | undefined setHealthPhase(page, "test") @@ -567,10 +595,7 @@ async function seedStorage( prompt: { enabled: true }, terminal: { enabled: true, terminals: {} }, } - localStorage.setItem( - "opencode.global.dat:model", - JSON.stringify({ recent: [args.model], user: [], variant: {} }), - ) + localStorage.setItem("opencode.global.dat:model", JSON.stringify({ recent: [args.model], user: [], variant: {} })) }, { directory: input.directory, serverUrl: origin, extra: input.extra ?? [], model: input.model ?? seedModel }, ) diff --git a/packages/app/e2e/session/session-composer-dock.spec.ts b/packages/app/e2e/session/session-composer-dock.spec.ts index e997f29f84..8eeac5b1a1 100644 --- a/packages/app/e2e/session/session-composer-dock.spec.ts +++ b/packages/app/e2e/session/session-composer-dock.spec.ts @@ -242,9 +242,7 @@ async function withMockPermission( const list = Array.isArray(json) ? json : Array.isArray(json?.data) ? json.data : undefined if (Array.isArray(list) && !list.some((item) => item?.id === opts.child?.id)) list.push(opts.child) await route.fulfill({ - status: res.status(), - headers: res.headers(), - contentType: "application/json", + response: res, body: JSON.stringify(json), }) }