Skip to content

An agentic browser harness: an AI side panel & orb in your own logged-in Chrome, Edge, Arc, Brave or even Firefox run by the agent/subscription you already use (Claude Code, Codex, Antigravity). Free, open source, no API key. Also an MCP server.

test(agents): DeepSeek Harness turns are replayed from what dsh 0.2.1-rc.2 printed, over ACP and headless, from a real account turn to a sign-in that is missing

Shahriar0b5b29987d7a
diff --git a/src/daemon/agent/runners/acp.ts b/src/daemon/agent/runners/acp.ts
index a1ef656..1748475 100644
--- a/src/daemon/agent/runners/acp.ts
+++ b/src/daemon/agent/runners/acp.ts
@@ -143,7 +143,7 @@ export function acpConversation(context: StreamContext, agent: AcpAgent): Conver
const entry = offered.find((candidate) => candidate.id === pinned);
if (!pinned || choice?.currentValue === (entry?.value ?? pinned)) return chooseEffort(options, io, sink);
if (!entry) {
- const some = offered.map((candidate) => candidate.id).slice(0, 6);
+ const some = [...new Set(offered.map((candidate) => candidate.id))].slice(0, 6);
return sink.fail(
'AGENT_FAILED',
`${agent.label} offers no model "${pinned}" here.${some.length ? ` It offers ${some.join(', ')}, among others.` : ''} ` +
diff --git a/src/daemon/agent/runners/deepseek.test.ts b/src/daemon/agent/runners/deepseek.test.ts
new file mode 100644
index 0000000..12d5bcb
--- /dev/null
+++ b/src/daemon/agent/runners/deepseek.test.ts
@@ -0,0 +1,268 @@
+import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
+import { homedir, tmpdir } from 'node:os';
+import { join } from 'node:path';
+import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
+import { deepseekRunner } from './deepseek';
+import { jsonContext, readThrough, streamContext, transcript, type Call } from './fixtures/support';
+import type { Conversation, StreamContext, StreamSink } from './types';
+
+const SESSION = '942f4fe8-050b-49f9-8426-40bef1b73a35';
+const SETTINGS = { bin: 'dsh' };
+
+interface Written {
+ id?: number;
+ method?: string;
+ params?: Record<string, unknown>;
+}
+
+const parsed = (line: string): Written & { result?: { configOptions?: { id: string }[] } } => {
+ try {
+ return JSON.parse(line) as Written;
+ } catch {
+ return {};
+ }
+};
+const frames = (name: string) => transcript('deepseek', `0.2.1-rc.2-acp-${name}.jsonl`);
+const answerTo = (name: string, id: number) => frames(name).find((line) => parsed(line).id === id) as string;
+const notices = (name: string) => frames(name).filter((line) => parsed(line).method === 'session/update');
+const headless = (name: string) => transcript('deepseek', `0.2.1-rc.2-headless-${name}.jsonl`);
+
+/** A tool update the recordings do not hold, in the shape dsh sends one. */
+const update = (sessionUpdate: string, fields: Record<string, unknown>, sessionId = SESSION) =>
+ JSON.stringify({ jsonrpc: '2.0', method: 'session/update', params: { sessionId, update: { sessionUpdate, ...fields } } });
+
+function holding(overrides: Partial<StreamContext> = {}) {
+ const written: Written[] = [];
+ const calls: Call[] = [];
+ const record =
+ (signal: keyof StreamSink) =>
+ (...args: unknown[]) =>
+ void calls.push([signal, ...args]);
+ const sink: StreamSink = {
+ text: record('text'),
+ tool: record('tool'),
+ toolResult: record('toolResult'),
+ session: record('session'),
+ usage: record('usage'),
+ done: record('done'),
+ fail: record('fail'),
+ };
+ const io = { write: (message: unknown) => void written.push(message as Written) };
+ const conversation = deepseekRunner.converse?.(streamContext(SETTINGS, overrides)) as Conversation;
+ conversation.open(io);
+ const feed = (...lines: string[]) => lines.forEach((line) => conversation.read(line, sink, io));
+ return {
+ conversation,
+ written,
+ calls,
+ feed,
+ asked: (method: string) => written.filter((message) => message.method === method),
+ signals: (signal: keyof StreamSink) => calls.filter(([name]) => name === signal),
+ /** Opens the recorded session and lets its prompt go. */
+ async opened() {
+ feed(answerTo('turn', 1), answerTo('turn', 3));
+ await vi.runAllTimersAsync();
+ },
+ };
+}
+
+beforeEach(() => vi.useFakeTimers());
+afterEach(() => vi.useRealTimers());
+
+describe('a turn over ACP', () => {
+ test('a new session and a resumed one are each handed the browser server, with the run id in its own environment', () => {
+ const fresh = holding();
+ fresh.feed(answerTo('turn', 1));
+ const resumed = holding({ sessionId: SESSION });
+ resumed.feed(answerTo('turn', 1));
+ const server = {
+ name: 'browsentic',
+ command: '/usr/local/bin/node',
+ args: ['/usr/local/lib/node_modules/browsentic/dist/cli.js', 'mcp'],
+ env: [{ name: 'BROWSENTIC_AGENT_RUN', value: 'run-1' }],
+ };
+ expect(fresh.asked('session/new')[0].params).toEqual({ cwd: fresh.conversation.plan.cwd, mcpServers: [server] });
+ expect(resumed.asked('session/resume')[0].params).toEqual({ sessionId: SESSION, cwd: resumed.conversation.plan.cwd, mcpServers: [server] });
+ });
+
+ test('a recorded turn reaches the panel as its answer alone: the browser call draws itself, and dsh’s own log line is passed over', async () => {
+ const turn = holding();
+ await turn.opened();
+ expect(turn.asked('session/prompt')).toHaveLength(1);
+ turn.feed(...frames('turn').filter((line) => !line.startsWith('{')), ...notices('turn'), answerTo('turn', 6));
+ expect(turn.calls).toEqual([
+ ['session', SESSION],
+ ['text', 'The page title is "Example Domain".'],
+ ['done', 'end_turn'],
+ ]);
+ });
+
+ test('a pinned model is asked for under the provider the session opened on, and one the account lacks is named', async () => {
+ const pinned = holding({ settings: { ...SETTINGS, model: 'deepseek-v4-pro' } });
+ await pinned.opened();
+ expect(pinned.asked('session/set_config_option')[0].params).toMatchObject({ configId: 'model', value: '["deepseek-account","deepseek-v4-pro"]' });
+
+ const missing = holding({ settings: { ...SETTINGS, model: 'deepseek-r9' } });
+ await missing.opened();
+ expect(missing.signals('fail')).toEqual([
+ ['fail', 'AGENT_FAILED', 'DeepSeek Harness offers no model "deepseek-r9" here. It offers deepseek-flash, deepseek-v4-pro, among others. Pick one in the Browsentic side panel, then try again.'],
+ ]);
+ });
+
+ test('an effort goes as its reasoning_effort', async () => {
+ const effort = holding({ settings: { ...SETTINGS, effort: 'max' } });
+ await effort.opened();
+ expect(effort.asked('session/set_config_option')[0].params).toMatchObject({ configId: 'reasoning_effort', value: 'max' });
+ });
+
+ test('each message the model commits is a paragraph of its own', async () => {
+ const turn = holding();
+ await turn.opened();
+ const messages = notices('messages').map((line) => line.replace(/"sessionId":"[^"]+"/, `"sessionId":"${SESSION}"`));
+ turn.feed(...messages);
+ expect(turn.signals('text')).toEqual([['text', 'First.'], ['text', '\n\n'], ['text', 'Done 4.']]);
+ });
+
+ test('a tool the model only named is not taken for one that ran', async () => {
+ const turn = holding();
+ await turn.opened();
+ turn.feed(...notices('unknown-tool').map((line) => line.replace(/"sessionId":"[^"]+"/, `"sessionId":"${SESSION}"`)));
+ expect(turn.signals('fail')).toEqual([]);
+ });
+
+ test('a built-in that ran stops the run, whether it finished or failed', async () => {
+ for (const status of ['completed', 'failed']) {
+ const turn = holding();
+ await turn.opened();
+ turn.feed(
+ update('tool_call', { toolCallId: 't1', title: 'bash', kind: 'other', status: 'in_progress' }),
+ update('tool_call_update', { toolCallId: 't1', status, content: [{ type: 'content', content: { type: 'text', text: 'Error: exit 1' } }] }),
+ );
+ expect(turn.signals('fail')[0]?.slice(0, 2)).toEqual(['fail', 'AGENT_UNSAFE']);
+ }
+ });
+
+ test('its to-do list and a browser call that dsh abandoned pass quietly, and the web draws itself on research', async () => {
+ const turn = holding({ research: true });
+ await turn.opened();
+ turn.feed(
+ update('tool_call', { toolCallId: 't1', title: 'todo_write', kind: 'other', status: 'in_progress' }),
+ update('tool_call_update', { toolCallId: 't1', status: 'completed' }),
+ ...notices('timeout').map((line) => line.replace(/"sessionId":"[^"]+"/, `"sessionId":"${SESSION}"`)),
+ update('tool_call', { toolCallId: 't2', title: 'web_search', kind: 'other', status: 'in_progress' }),
+ update('tool_call_update', { toolCallId: 't2', status: 'completed' }),
+ );
+ expect(turn.calls.filter(([signal]) => signal !== 'text' && signal !== 'session')).toEqual([
+ ['tool', 't2', 'web_search'],
+ ['toolResult', 't2', true],
+ ]);
+ });
+
+ test('a cancelled prompt ends the run as cancelled', async () => {
+ const turn = holding();
+ await turn.opened();
+ turn.feed(answerTo('cancelled', 6));
+ expect(turn.signals('fail')).toEqual([['fail', 'CANCELLED', 'Run cancelled.']]);
+ });
+
+ test('a session dsh no longer holds is started afresh', () => {
+ const turn = holding({ sessionId: '00000000-0000-4000-8000-000000000000' });
+ turn.feed(answerTo('turn', 1), answerTo('resume-missing', 2));
+ expect(turn.asked('session/new')).toHaveLength(1);
+ });
+
+ test('a turn with no sign-in says how to sign in', async () => {
+ const turn = holding();
+ await turn.opened();
+ turn.feed(answerTo('signed-out', 6));
+ expect(turn.signals('fail')).toEqual([
+ ['fail', 'AGENT_FAILED', expect.stringMatching(/^DeepSeek Harness is not signed in\. Run "dsh web" and sign in with your DeepSeek account, or set DEEPSEEK_API_KEY\./)],
+ ]);
+ });
+});
+
+describe('headless', () => {
+ test('a turn it falls back to reaches the panel as its answer and its usage, with the browser call left to draw itself', () => {
+ expect(readThrough(deepseekRunner, headless('browser'))).toEqual([
+ ['session', 'session-80cd2744-55c8-423c-a9b7-7efa8e3610bc'],
+ ['usage', { contextTokens: 13, outputTokens: 3 }],
+ ['text', 'Done 3.'],
+ ['usage', { contextTokens: 13, outputTokens: 6 }],
+ ['done', 'end_turn'],
+ ]);
+ });
+
+ test('a one-shot answers with its final text, past a line of dsh’s own that is not JSON', () => {
+ const stdout = ['[llm-deepseek-account] model listing from https://api.deepseek.com/models loaded 2 model(s), skipped 0 row(s)', ...headless('read')].join('\n');
+ expect(deepseekRunner.answer(stdout)).toEqual({ text: 'Done 3.' });
+ });
+
+ test('a one-shot with no sign-in, and the line it leaves on stderr, say how to sign in', () => {
+ expect(deepseekRunner.answer(headless('signed-out').join('\n')).error).toMatch(/^DeepSeek Harness is not signed in/);
+ const stderr = 'dsh: MISSING_CREDENTIAL: llm-deepseek: no API key for provider route "deepseek-official"; store DEEPSEEK_API_KEY …';
+ expect(deepseekRunner.hint?.(stderr)).toMatch(/^DeepSeek Harness is not signed in/);
+ });
+
+ test('a dsh whose plugin tree moved on asks for both to be updated', () => {
+ expect(deepseekRunner.hint?.('dsh: [/x/browsentic.patch.yml] patch: entry "tool-goal" not found')).toMatch(/^Your DeepSeek Harness has changed/);
+ });
+});
+
+describe('plans', () => {
+ const rowsOf = (content: string) => JSON.parse(content) as { id?: string; disabled?: boolean; config?: Record<string, unknown>; insert?: unknown[] }[];
+
+ test('a turn borrows the user’s sign-in from their own dsh home, and keeps a home of Browsentic’s', () => {
+ const plan = (deepseekRunner.converse?.(streamContext(SETTINGS)) as Conversation).plan;
+ const rows = rowsOf(plan.files!.find((file) => file.path === 'browsentic.patch.yml')!.content);
+ expect(rows.find((row) => row.id === 'credentials')).toEqual({ id: 'credentials', disabled: false, config: { path: join(process.env.DSH_HOME || join(homedir(), '.dsh'), '.credentials.yaml') } });
+ expect(plan.env?.DSH_HOME).toMatch(/agents[\\/]deepseek[\\/]home$/);
+ expect(plan.files!.find((file) => file.path === 'AGENTS.md')?.content).toBe('You are Browsentic.');
+ });
+
+ test('the web stays off but on research, and a one-shot that reads is given read and nothing else', () => {
+ const turnRows = (research: boolean) => rowsOf((deepseekRunner.converse?.(streamContext(SETTINGS, { research })) as Conversation).plan.files![0].content);
+ expect(turnRows(false).some((row) => row.id === 'tool-web' && row.disabled)).toBe(true);
+ expect(turnRows(true).some((row) => row.id === 'tool-web')).toBe(false);
+ const reading = rowsOf(deepseekRunner.json(jsonContext(SETTINGS, { reads: true })).files![0].content);
+ expect(reading.filter((row) => row.id === 'tool-fs')).toEqual([{ id: 'tool-fs', config: { read: true, readImage: false, write: false, edit: false } }]);
+ expect(rowsOf(deepseekRunner.json(jsonContext(SETTINGS)).files![0].content).find((row) => row.id === 'tool-fs')).toEqual({ id: 'tool-fs', disabled: true });
+ });
+
+ test('the turn it falls back to mounts the browser server through the patch, and resumes only a session of its own kind', () => {
+ const plan = deepseekRunner.stream(streamContext(SETTINGS, { sessionId: SESSION }));
+ expect(rowsOf(plan.files![0].content).filter((row) => row.insert)).toHaveLength(1);
+ expect(plan.args).not.toContain('--session-id');
+ expect(deepseekRunner.stream(streamContext(SETTINGS, { sessionId: 'session-1' })).args).toEqual(expect.arrayContaining(['--session-id', 'session-1']));
+ });
+});
+
+describe('readiness', () => {
+ const was = { home: process.env.DSH_HOME, key: process.env.DEEPSEEK_API_KEY };
+ let home: string;
+ beforeEach(() => {
+ home = mkdtempSync(join(tmpdir(), 'dsh-home-'));
+ process.env.DSH_HOME = home;
+ delete process.env.DEEPSEEK_API_KEY;
+ });
+ afterEach(() => {
+ rmSync(home, { recursive: true, force: true });
+ for (const [name, value] of [['DSH_HOME', was.home], ['DEEPSEEK_API_KEY', was.key]] as const) {
+ if (value === undefined) delete process.env[name];
+ else process.env[name] = value;
+ }
+ });
+
+ test('a DeepSeek account `dsh web` signed in to, a stored key, or one in the environment is enough', async () => {
+ writeFileSync(join(home, '.credentials.yaml'), 'version: 1\nrecords:\n deepseek-account-platform/default:\n kind: token\n');
+ expect(await deepseekRunner.check?.(SETTINGS)).toBeNull();
+ writeFileSync(join(home, '.credentials.yaml'), 'version: 1\nrefs:\n DEEPSEEK_API_KEY: sk-x\n');
+ expect(await deepseekRunner.check?.(SETTINGS)).toBeNull();
+ rmSync(join(home, '.credentials.yaml'));
+ process.env.DEEPSEEK_API_KEY = 'sk-x';
+ expect(await deepseekRunner.check?.(SETTINGS)).toBeNull();
+ });
+
+ test('no sign-in at all asks for one', async () => {
+ expect(await deepseekRunner.check?.(SETTINGS)).toMatchObject({ code: 'AGENT_NEEDS_PERMISSION', fix: 'dsh web' });
+ });
+});
diff --git a/src/daemon/agent/runners/fixtures/README.md b/src/daemon/agent/runners/fixtures/README.md
index e24310f..0c1408c 100644
--- a/src/daemon/agent/runners/fixtures/README.md
+++ b/src/daemon/agent/runners/fixtures/README.md
@@ -13,7 +13,12 @@ What each agent CLI printed on stdout, one event per line, for the reader tests
`cf-placement` headers; paths became `/Users/you`. OpenCode 2.0.32's were recorded the same way,
from `opencode run --standalone` and from `opencode acp`; the `acp-` ones keep only what the CLI
printed, with its replies renumbered to the request ids the runner uses, and both `free-tier`
- recordings were answered by the real Zen endpoint. Codex's `web-search`, `shell`, `two-calls` and `tool-search`
+ recordings were answered by the real Zen endpoint. DeepSeek Harness 0.2.1-rc.2's were recorded through
+ the runner's plans with a stand-in for the browser's MCP server: the `acp-` ones keep only what
+ `dsh --profile acp` printed, with its replies renumbered to the runner's request ids, and the
+ `headless-` ones what `dsh --profile headless --json` printed. `acp-turn` was answered by a real
+ DeepSeek account and keeps the line of dsh's own that is not JSON; the rest by a local stand-in
+ model. Paths became `/Users/you`. Codex's `web-search`, `shell`, `two-calls` and `tool-search`
and Claude Code's `mcp-failed` were recorded the same way, each saying so in its first line.
- `<case>.hand-written.jsonl` was written from the reader code, for streams a contained run cannot
produce or a CLI that was not installed. Its first line says so.
diff --git a/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-cancelled.jsonl b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-cancelled.jsonl
new file mode 100644
index 0000000..df9aa00
--- /dev/null
+++ b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-cancelled.jsonl
@@ -0,0 +1,7 @@
+# Printed by `dsh --profile acp` 0.2.1-rc.2 to a client speaking the runner's protocol, its request ids renumbered to the runner's own. The turn was cancelled with session/cancel while a browser tool was running.
+{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":1,"agentInfo":{"name":"deepseek-harness-acp","version":"0.0.1"},"agentCapabilities":{"mcpCapabilities":{"http":true},"promptCapabilities":{"image":true,"audio":false,"embeddedContext":false},"sessionCapabilities":{"close":{},"list":{},"resume":{}}},"authMethods":[]}}
+{"jsonrpc":"2.0","id":3,"result":{"sessionId":"0a6e32fc-4e08-4f0e-8f25-6ba29af50d46","configOptions":[{"id":"model","name":"Model","category":"model","type":"select","currentValue":"[\"deepseek-official\",\"deepseek-flash\"]","options":[{"group":"deepseek-official","name":"DeepSeek","options":[{"value":"[\"deepseek-official\",\"deepseek-flash\"]","name":"DeepSeek-V4.1-Flash"},{"value":"[\"deepseek-official\",\"deepseek-v4-pro\"]","name":"DeepSeek-V4-Pro","description":"Stronger agentic coding, knowledge, and difficult reasoning; suited to complex or quality-critical tasks at higher cost."}]}]},{"id":"reasoning_effort","name":"Reasoning effort","category":"thought_level","type":"select","currentValue":"high","options":[{"value":"off","name":"Off","description":"Use for simple tasks that do not need reasoning."},{"value":"low","name":"Low","description":"Prefer for routine or latency-sensitive tasks."},{"value":"high","name":"High","description":"The default balance for most tasks."},{"value":"max","name":"Max","description":"Reserve for the hardest quality-first tasks."}]}]}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"0a6e32fc-4e08-4f0e-8f25-6ba29af50d46","update":{"sessionUpdate":"usage_update","used":691,"size":1000000}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"0a6e32fc-4e08-4f0e-8f25-6ba29af50d46","update":{"sessionUpdate":"tool_call","toolCallId":"toolu_3","title":"mcp__browsentic__page_sleep70","kind":"other","status":"in_progress","rawInput":{}}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"0a6e32fc-4e08-4f0e-8f25-6ba29af50d46","update":{"sessionUpdate":"tool_call_update","toolCallId":"toolu_3","status":"failed","content":[{"type":"content","content":{"type":"text","text":"Error: [object Object]"}}]}}}
+{"jsonrpc":"2.0","id":6,"result":{"stopReason":"cancelled"}}
diff --git a/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-messages.jsonl b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-messages.jsonl
new file mode 100644
index 0000000..edd60d8
--- /dev/null
+++ b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-messages.jsonl
@@ -0,0 +1,10 @@
+# Printed by `dsh --profile acp` 0.2.1-rc.2 to a client speaking the runner's protocol, its request ids renumbered to the runner's own. A local stand-in model answered with words, a browser tool call, then words again.
+{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":1,"agentInfo":{"name":"deepseek-harness-acp","version":"0.0.1"},"agentCapabilities":{"mcpCapabilities":{"http":true},"promptCapabilities":{"image":true,"audio":false,"embeddedContext":false},"sessionCapabilities":{"close":{},"list":{},"resume":{}}},"authMethods":[]}}
+{"jsonrpc":"2.0","id":3,"result":{"sessionId":"2dac1787-b927-4585-b4c8-51841fdf2dab","configOptions":[{"id":"model","name":"Model","category":"model","type":"select","currentValue":"[\"deepseek-official\",\"deepseek-flash\"]","options":[{"group":"deepseek-official","name":"DeepSeek","options":[{"value":"[\"deepseek-official\",\"deepseek-flash\"]","name":"DeepSeek-V4.1-Flash"},{"value":"[\"deepseek-official\",\"deepseek-v4-pro\"]","name":"DeepSeek-V4-Pro","description":"Stronger agentic coding, knowledge, and difficult reasoning; suited to complex or quality-critical tasks at higher cost."}]}]},{"id":"reasoning_effort","name":"Reasoning effort","category":"thought_level","type":"select","currentValue":"high","options":[{"value":"off","name":"Off","description":"Use for simple tasks that do not need reasoning."},{"value":"low","name":"Low","description":"Prefer for routine or latency-sensitive tasks."},{"value":"high","name":"High","description":"The default balance for most tasks."},{"value":"max","name":"Max","description":"Reserve for the hardest quality-first tasks."}]}]}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"2dac1787-b927-4585-b4c8-51841fdf2dab","update":{"sessionUpdate":"agent_message_chunk","messageId":"c739172d-b7ed-4008-a9f9-afd48d7d09e5","content":{"type":"text","text":"First."}}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"2dac1787-b927-4585-b4c8-51841fdf2dab","update":{"sessionUpdate":"usage_update","used":694,"size":1000000}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"2dac1787-b927-4585-b4c8-51841fdf2dab","update":{"sessionUpdate":"tool_call","toolCallId":"toolu_3","title":"mcp__browsentic__page_getPageInfo","kind":"other","status":"in_progress","rawInput":{}}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"2dac1787-b927-4585-b4c8-51841fdf2dab","update":{"sessionUpdate":"tool_call_update","toolCallId":"toolu_3","status":"completed","content":[{"type":"content","content":{"type":"text","text":"title: Example Domain"}}]}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"2dac1787-b927-4585-b4c8-51841fdf2dab","update":{"sessionUpdate":"agent_message_chunk","messageId":"8c5ff396-5e3f-4600-a18c-9071e5496eca","content":{"type":"text","text":"Done 4."}}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"2dac1787-b927-4585-b4c8-51841fdf2dab","update":{"sessionUpdate":"usage_update","used":718,"size":1000000}}}
+{"jsonrpc":"2.0","id":6,"result":{"stopReason":"end_turn"}}
diff --git a/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-resume-missing.jsonl b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-resume-missing.jsonl
new file mode 100644
index 0000000..9fa21a8
--- /dev/null
+++ b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-resume-missing.jsonl
@@ -0,0 +1,4 @@
+# Printed by `dsh --profile acp` 0.2.1-rc.2 to a client speaking the runner's protocol, its request ids renumbered to the runner's own. A resume of a session id dsh never held.
+{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":1,"agentInfo":{"name":"deepseek-harness-acp","version":"0.0.1"},"agentCapabilities":{"mcpCapabilities":{"http":true},"promptCapabilities":{"image":true,"audio":false,"embeddedContext":false},"sessionCapabilities":{"close":{},"list":{},"resume":{}}},"authMethods":[]}}
+{"jsonrpc":"2.0","id":2,"error":{"code":-32602,"message":"Invalid params: session is not resumable: 00000000-0000-4000-8000-000000000000"}}
+{"jsonrpc":"2.0","id":2,"error":{"code":-32602,"message":"Invalid params: session cwd does not match: /Users/you/.browsentic/agents/deepseek/run/conversation-1"}}
diff --git a/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-signed-out.jsonl b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-signed-out.jsonl
new file mode 100644
index 0000000..d94975a
--- /dev/null
+++ b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-signed-out.jsonl
@@ -0,0 +1,4 @@
+# Printed by `dsh --profile acp` 0.2.1-rc.2 to a client speaking the runner's protocol, its request ids renumbered to the runner's own. The account route with no sign-in.
+{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":1,"agentInfo":{"name":"deepseek-harness-acp","version":"0.0.1"},"agentCapabilities":{"mcpCapabilities":{"http":true},"promptCapabilities":{"image":true,"audio":false,"embeddedContext":false},"sessionCapabilities":{"close":{},"list":{},"resume":{}}},"authMethods":[]}}
+{"jsonrpc":"2.0","id":3,"result":{"sessionId":"9733384f-3729-4a37-880c-5810b74b2bd3","configOptions":[{"id":"model","name":"Model","category":"model","type":"select","currentValue":"[\"deepseek-account\",\"deepseek-flash\"]","options":[{"group":"deepseek-account","name":"DeepSeek Account","options":[{"value":"[\"deepseek-account\",\"deepseek-flash\"]","name":"deepseek-flash"}]}]},{"id":"reasoning_effort","name":"Reasoning effort","category":"thought_level","type":"select","currentValue":"high","options":[{"value":"off","name":"Off","description":"Use for simple tasks that do not need reasoning."},{"value":"low","name":"Low","description":"Prefer for routine or latency-sensitive tasks."},{"value":"high","name":"High","description":"The default balance for most tasks."},{"value":"max","name":"Max","description":"Reserve for the hardest quality-first tasks."}]}]}}
+{"jsonrpc":"2.0","id":6,"error":{"code":-32603,"message":"Internal error: turn failed: Sign in to DeepSeek to use the account provider. The request destination must allow account authentication."}}
diff --git a/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-timeout.jsonl b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-timeout.jsonl
new file mode 100644
index 0000000..53f02d5
--- /dev/null
+++ b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-timeout.jsonl
@@ -0,0 +1,9 @@
+# Printed by `dsh --profile acp` 0.2.1-rc.2 to a client speaking the runner's protocol, its request ids renumbered to the runner's own. A local stand-in model called a browser tool that answered after 70 s, which dsh abandoned at 60.
+{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":1,"agentInfo":{"name":"deepseek-harness-acp","version":"0.0.1"},"agentCapabilities":{"mcpCapabilities":{"http":true},"promptCapabilities":{"image":true,"audio":false,"embeddedContext":false},"sessionCapabilities":{"close":{},"list":{},"resume":{}}},"authMethods":[]}}
+{"jsonrpc":"2.0","id":3,"result":{"sessionId":"e7b27985-d8fd-4b98-b56e-09c87bd93318","configOptions":[{"id":"model","name":"Model","category":"model","type":"select","currentValue":"[\"deepseek-official\",\"deepseek-flash\"]","options":[{"group":"deepseek-official","name":"DeepSeek","options":[{"value":"[\"deepseek-official\",\"deepseek-flash\"]","name":"DeepSeek-V4.1-Flash"},{"value":"[\"deepseek-official\",\"deepseek-v4-pro\"]","name":"DeepSeek-V4-Pro","description":"Stronger agentic coding, knowledge, and difficult reasoning; suited to complex or quality-critical tasks at higher cost."}]}]},{"id":"reasoning_effort","name":"Reasoning effort","category":"thought_level","type":"select","currentValue":"high","options":[{"value":"off","name":"Off","description":"Use for simple tasks that do not need reasoning."},{"value":"low","name":"Low","description":"Prefer for routine or latency-sensitive tasks."},{"value":"high","name":"High","description":"The default balance for most tasks."},{"value":"max","name":"Max","description":"Reserve for the hardest quality-first tasks."}]}]}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"e7b27985-d8fd-4b98-b56e-09c87bd93318","update":{"sessionUpdate":"usage_update","used":690,"size":1000000}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"e7b27985-d8fd-4b98-b56e-09c87bd93318","update":{"sessionUpdate":"tool_call","toolCallId":"toolu_1","title":"mcp__browsentic__page_sleep70","kind":"other","status":"in_progress","rawInput":{}}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"e7b27985-d8fd-4b98-b56e-09c87bd93318","update":{"sessionUpdate":"tool_call_update","toolCallId":"toolu_1","status":"failed","content":[{"type":"content","content":{"type":"text","text":"Error: Request timed out"}}]}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"e7b27985-d8fd-4b98-b56e-09c87bd93318","update":{"sessionUpdate":"agent_message_chunk","messageId":"6031c0eb-2fe3-476e-9645-71f05924ad80","content":{"type":"text","text":"Done 2."}}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"e7b27985-d8fd-4b98-b56e-09c87bd93318","update":{"sessionUpdate":"usage_update","used":714,"size":1000000}}}
+{"jsonrpc":"2.0","id":6,"result":{"stopReason":"end_turn"}}
diff --git a/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-turn.jsonl b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-turn.jsonl
new file mode 100644
index 0000000..c9579f2
--- /dev/null
+++ b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-turn.jsonl
@@ -0,0 +1,11 @@
+# Printed by `dsh --profile acp` 0.2.1-rc.2 to a client speaking the runner's protocol, its request ids renumbered to the runner's own. A real DeepSeek account answered; the browser's server was a stand-in. The line that is not JSON is dsh's own, on stdout.
+{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":1,"agentInfo":{"name":"deepseek-harness-acp","version":"0.0.1"},"agentCapabilities":{"mcpCapabilities":{"http":true},"promptCapabilities":{"image":true,"audio":false,"embeddedContext":false},"sessionCapabilities":{"close":{},"list":{},"resume":{}}},"authMethods":[]}}
+[llm-deepseek-account] model listing from https://api.deepseek.com/models loaded 2 model(s), skipped 0 row(s)
+{"jsonrpc":"2.0","id":3,"result":{"sessionId":"942f4fe8-050b-49f9-8426-40bef1b73a35","configOptions":[{"id":"model","name":"Model","category":"model","type":"select","currentValue":"[\"deepseek-account\",\"deepseek-flash\"]","options":[{"group":"deepseek-official","name":"DeepSeek","options":[{"value":"[\"deepseek-official\",\"deepseek-flash\"]","name":"DeepSeek-V4.1-Flash"},{"value":"[\"deepseek-official\",\"deepseek-v4-pro\"]","name":"DeepSeek-V4-Pro","description":"Stronger agentic coding, knowledge, and difficult reasoning; suited to complex or quality-critical tasks at higher cost."}]},{"group":"deepseek-account","name":"DeepSeek Account","options":[{"value":"[\"deepseek-account\",\"deepseek-flash\"]","name":"DeepSeek-V4.1-Flash"},{"value":"[\"deepseek-account\",\"deepseek-v4-pro\"]","name":"DeepSeek-V4-Pro","description":"Stronger agentic coding, knowledge, and difficult reasoning; suited to complex or quality-critical tasks at higher cost."}]}]},{"id":"reasoning_effort","name":"Reasoning effort","category":"thought_level","type":"select","currentValue":"high","options":[{"value":"off","name":"Off","description":"Use for simple tasks that do not need reasoning."},{"value":"low","name":"Low","description":"Prefer for routine or latency-sensitive tasks."},{"value":"high","name":"High","description":"The default balance for most tasks."},{"value":"max","name":"Max","description":"Reserve for the hardest quality-first tasks."}]}]}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"942f4fe8-050b-49f9-8426-40bef1b73a35","update":{"sessionUpdate":"agent_thought_chunk","messageId":"a6da76ac-8e41-4944-ab77-6adf33128afc","content":{"type":"text","text":"The user wants me to call page_getPageInfo once and tell them the page title. Let me do that."}}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"942f4fe8-050b-49f9-8426-40bef1b73a35","update":{"sessionUpdate":"usage_update","used":987,"size":1048576}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"942f4fe8-050b-49f9-8426-40bef1b73a35","update":{"sessionUpdate":"tool_call","toolCallId":"call_00_GMwAHiLAWJ2daXLJDoqi4017","title":"mcp__browsentic__page_getPageInfo","kind":"other","status":"in_progress","rawInput":{}}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"942f4fe8-050b-49f9-8426-40bef1b73a35","update":{"sessionUpdate":"tool_call_update","toolCallId":"call_00_GMwAHiLAWJ2daXLJDoqi4017","status":"completed","content":[{"type":"content","content":{"type":"text","text":"title: Example Domain"}}]}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"942f4fe8-050b-49f9-8426-40bef1b73a35","update":{"sessionUpdate":"agent_message_chunk","messageId":"c8d463c4-2462-4b8d-a881-30d5775c5ffd","content":{"type":"text","text":"The page title is \"Example Domain\"."}}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"942f4fe8-050b-49f9-8426-40bef1b73a35","update":{"sessionUpdate":"usage_update","used":1012,"size":1048576}}}
+{"jsonrpc":"2.0","id":6,"result":{"stopReason":"end_turn"}}
diff --git a/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-unknown-tool.jsonl b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-unknown-tool.jsonl
new file mode 100644
index 0000000..0222cd3
--- /dev/null
+++ b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-acp-unknown-tool.jsonl
@@ -0,0 +1,9 @@
+# Printed by `dsh --profile acp` 0.2.1-rc.2 to a client speaking the runner's protocol, its request ids renumbered to the runner's own. A local stand-in model called a tool dsh does not have.
+{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":1,"agentInfo":{"name":"deepseek-harness-acp","version":"0.0.1"},"agentCapabilities":{"mcpCapabilities":{"http":true},"promptCapabilities":{"image":true,"audio":false,"embeddedContext":false},"sessionCapabilities":{"close":{},"list":{},"resume":{}}},"authMethods":[]}}
+{"jsonrpc":"2.0","id":3,"result":{"sessionId":"2c186263-7b30-4a53-882f-cadbd8fc4043","configOptions":[{"id":"model","name":"Model","category":"model","type":"select","currentValue":"[\"deepseek-official\",\"deepseek-flash\"]","options":[{"group":"deepseek-official","name":"DeepSeek","options":[{"value":"[\"deepseek-official\",\"deepseek-flash\"]","name":"DeepSeek-V4.1-Flash"},{"value":"[\"deepseek-official\",\"deepseek-v4-pro\"]","name":"DeepSeek-V4-Pro","description":"Stronger agentic coding, knowledge, and difficult reasoning; suited to complex or quality-critical tasks at higher cost."}]}]},{"id":"reasoning_effort","name":"Reasoning effort","category":"thought_level","type":"select","currentValue":"high","options":[{"value":"off","name":"Off","description":"Use for simple tasks that do not need reasoning."},{"value":"low","name":"Low","description":"Prefer for routine or latency-sensitive tasks."},{"value":"high","name":"High","description":"The default balance for most tasks."},{"value":"max","name":"Max","description":"Reserve for the hardest quality-first tasks."}]}]}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"2c186263-7b30-4a53-882f-cadbd8fc4043","update":{"sessionUpdate":"usage_update","used":684,"size":1000000}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"2c186263-7b30-4a53-882f-cadbd8fc4043","update":{"sessionUpdate":"tool_call","toolCallId":"toolu_1","title":"missing_bash","kind":"other","status":"in_progress","rawInput":{}}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"2c186263-7b30-4a53-882f-cadbd8fc4043","update":{"sessionUpdate":"tool_call_update","toolCallId":"toolu_1","status":"failed","content":[{"type":"content","content":{"type":"text","text":"Error: unknown tool \"missing_bash\""}}]}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"2c186263-7b30-4a53-882f-cadbd8fc4043","update":{"sessionUpdate":"agent_message_chunk","messageId":"3bd5f105-149f-413c-b74a-655d73abd46f","content":{"type":"text","text":"Done 2."}}}}
+{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"2c186263-7b30-4a53-882f-cadbd8fc4043","update":{"sessionUpdate":"usage_update","used":711,"size":1000000}}}
+{"jsonrpc":"2.0","id":6,"result":{"stopReason":"end_turn"}}
diff --git a/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-headless-browser.jsonl b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-headless-browser.jsonl
new file mode 100644
index 0000000..dd14a28
--- /dev/null
+++ b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-headless-browser.jsonl
@@ -0,0 +1,12 @@
+# Printed by `dsh --profile headless --json` 0.2.1-rc.2 through the runner's plan, with a local stand-in model, which called the browser's server the patch mounted, then answered.
+{"type":"session","sessionId":"session-80cd2744-55c8-423c-a9b7-7efa8e3610bc","cwd":"/Users/you/.browsentic/agents/deepseek/run/conversation-1"}
+{"type":"status","phase":"turn_start","turn":1}
+{"type":"status","phase":"step_start","turn":1,"step":1}
+{"type":"tool_call","callId":"toolu_1","tool":"mcp__browsentic__page_getPageInfo","input":{}}
+{"type":"tool_result","callId":"toolu_1","status":"completed","result":"title: Example Domain"}
+{"type":"status","phase":"step_end","turn":1,"step":1,"usage":{"inputTokens":10,"outputTokens":3,"totalTokens":13}}
+{"type":"status","phase":"step_start","turn":1,"step":2}
+{"type":"text","text":"Done 3."}
+{"type":"status","phase":"step_end","turn":1,"step":2,"usage":{"inputTokens":10,"outputTokens":3,"totalTokens":13}}
+{"type":"status","phase":"turn_end","turn":1,"reason":{"kind":"completed"}}
+{"type":"final","text":"Done 3."}
diff --git a/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-headless-read.jsonl b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-headless-read.jsonl
new file mode 100644
index 0000000..e887fe9
--- /dev/null
+++ b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-headless-read.jsonl
@@ -0,0 +1,12 @@
+# Printed by `dsh --profile headless --json` 0.2.1-rc.2 through the runner's plan, with a local stand-in model, which called the read tool a one-shot that reads is given, with no arguments, then answered.
+{"type":"session","sessionId":"session-f182ef1e-169f-463e-ab4c-045f11872a80","cwd":"/Users/you/.browsentic/agents/deepseek/task"}
+{"type":"status","phase":"turn_start","turn":1}
+{"type":"status","phase":"step_start","turn":1,"step":1}
+{"type":"tool_call","callId":"toolu_1","tool":"read","input":{}}
+{"type":"tool_result","callId":"toolu_1","status":"error","result":"Error: invalid arguments: missing required property \"file_path\""}
+{"type":"status","phase":"step_end","turn":1,"step":1,"usage":{"inputTokens":10,"outputTokens":3,"totalTokens":13}}
+{"type":"status","phase":"step_start","turn":1,"step":2}
+{"type":"text","text":"Done 3."}
+{"type":"status","phase":"step_end","turn":1,"step":2,"usage":{"inputTokens":10,"outputTokens":3,"totalTokens":13}}
+{"type":"status","phase":"turn_end","turn":1,"reason":{"kind":"completed"}}
+{"type":"final","text":"Done 3."}
diff --git a/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-headless-signed-out.jsonl b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-headless-signed-out.jsonl
new file mode 100644
index 0000000..c99ce6d
--- /dev/null
+++ b/src/daemon/agent/runners/fixtures/deepseek/0.2.1-rc.2-headless-signed-out.jsonl
@@ -0,0 +1,7 @@
+# Printed by `dsh --profile headless --json` 0.2.1-rc.2 with no sign-in at all; it exited 1.
+{"type":"session","sessionId":"session-867d6286-8d62-4775-9a54-659fba28e076","cwd":"/Users/you/.browsentic/agents/deepseek/task"}
+{"type":"status","phase":"turn_start","turn":1}
+{"type":"status","phase":"step_start","turn":1,"step":1}
+{"type":"status","phase":"step_end","turn":1,"step":1}
+{"type":"status","phase":"turn_end","turn":1,"reason":{"kind":"error","error":{"message":"llm-deepseek: no API key for provider route \"deepseek-official\"; store DEEPSEEK_API_KEY through the credentials service (the web Models page writes it), or export DEEPSEEK_API_KEY in the launching environment","code":"MISSING_CREDENTIAL"}}}
+{"type":"final","text":""}