Files
deepseek-harness/examples/acp-agent/tests/snapshots/multi-turn/stdout.golden.txt
T
Tianyi Cui c94f1563f5 test(acp-example): five snapshot scenarios + cancel/error input ops
Adds the first cut of snapshot scenarios, each asserting a normalized stdout
transcript golden and (for model turns) a re-persisted session-log golden:

- text-turn, tool-call-turn, multi-turn: RECORDED against the real API — the
  committed session.jsonl is a genuine harvested log; replay derives the model
  script from it and reproduces deterministically with no key. tool-call-turn
  exercises the real bash executor (echo SNAPSHOT_OK → tool/call + tool/result
  + a post-tool answer step).
- error-finish, cancel: AUTHORED via a replay.override.json sidecar (the live
  API can't be coaxed into a deterministic 401 or mid-stream cancel). error-
  finish replays a {kind:throw} 401 → the bridge answers the prompt with a
  JSON-RPC error and the log records turn/end{kind:error}; cancel replays a
  {kind:hang} → stopReason:cancelled.

Two input-DSL ops support these: promptExpectError (awaits the prompt, asserts
it rejects — the editor's view of a failed turn — and swallows it) and
promptAndCancel (dispatches the prompt unawaited, waits until the client
OBSERVES the streamed agent_message_chunk, then cancels — pinning frame order
so the cancel transcript is deterministic; fixes a flake Codex caught where the
late chunk and the cancelled response could interleave either way).

Scenarios carry a `recorded` flag so test:snapshot:record only re-runs the
live-API ones. reasoning/max-tokens scenarios are deferred (hard to force
deterministically from the live model). Per docs/rfc/implemented/2026-06-19.
2026-06-19 04:10:49 +08:00

616 lines
11 KiB
Plaintext

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": 1,
"agentInfo": {
"name": "deepseek-harness-acp",
"version": "0.0.1"
},
"agentCapabilities": {
"loadSession": true,
"promptCapabilities": {
"image": false,
"audio": false,
"embeddedContext": false
}
},
"authMethods": []
}
}
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"sessionId": "{{sessionId}}"
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "user_message_chunk",
"content": {
"type": "text",
"text": "Reply with exactly the word: ONE. No tools."
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": "The"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " user"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " wants"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " me"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " to"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " reply"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " with"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " exactly"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " the"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " word"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " \""
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": "ONE"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": "\""
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " and"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " no"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " tools"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": "."
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_message_chunk",
"content": {
"type": "text",
"text": "ONE"
}
}
}
}
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"stopReason": "end_turn"
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "user_message_chunk",
"content": {
"type": "text",
"text": "Reply with exactly the word: TWO. No tools."
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": "The"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " user"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " wants"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " me"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " to"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " reply"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " with"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " exactly"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " the"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " word"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " \""
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": "T"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": "WO"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": "\""
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " and"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " use"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " no"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": " tools"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_thought_chunk",
"content": {
"type": "text",
"text": "."
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_message_chunk",
"content": {
"type": "text",
"text": "T"
}
}
}
}
{
"jsonrpc": "2.0",
"method": "session/update",
"params": {
"sessionId": "{{sessionId}}",
"update": {
"sessionUpdate": "agent_message_chunk",
"content": {
"type": "text",
"text": "WO"
}
}
}
}
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"stopReason": "end_turn"
}
}