ch31_stop_resume

show:
mock turns=0 · messages=0
live turns=0 · messages=0
scenario a_snapshot_after_every_turn_lets_a_new_process_resume
scenario a_snapshot_after_every_turn_lets_a_new_process_resume · 5.3ms
turn 1 · 4.2ms · asked for: check_order
model mock · 4.0ms · asked for: check_order
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhat's the status of order A100?
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
tools declared to the mock model {"names": ["check_order"], "consulted": false}
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]ai
check_order({"order_id": "A100"})
tool check_order · 0.2ms · given: order_id=A100 · returned: order A100: shipped, tracking XYZ001
args {"order_id": "A100"}
result {"value": "order A100: shipped, tracking XYZ001"}
turn 2 · 0.3ms · responded with: Order A100 has shipped.
model mock · 0.3ms · responded with: Order A100 has shipped.
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhat's the status of order A100?
[2]ai
check_order({"order_id": "A100"})
[3]toolorder A100: shipped, tracking XYZ001
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
tools declared to the mock model {"names": ["check_order"], "consulted": false}
context ignored by the mock model {"messages": 4, "roles": ["system", "human", "ai", "tool"]}
reply
rolecontent
[0]aiOrder A100 has shipped.
snapshot_written open file {"path": "out/ch31_stop_resume/a_snapshot_after_every_turn_lets_a_new_process_resume/order-support-run.jsonl", "turn": 2}
turn 3 · 0.2ms · responded with: Tracking number: XYZ001.
model mock · 0.2ms · responded with: Tracking number: XYZ001.
context sent — 6 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhat's the status of order A100?
[2]ai
check_order({"order_id": "A100"})
[3]toolorder A100: shipped, tracking XYZ001
[4]aiOrder A100 has shipped.
[5]humanAnd what's the tracking number?
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
tools declared to the mock model {"names": ["check_order"], "consulted": false}
context ignored by the mock model {"messages": 6, "roles": ["system", "human", "ai", "tool", "ai", "human"]}
reply
rolecontent
[0]aiTracking number: XYZ001.
resumed_in_a_new_process open file {"path": "out/ch31_stop_resume/a_snapshot_after_every_turn_lets_a_new_process_resume/order-support-run.jsonl", "resumed_from_turn": 2, "final_message_count": 7, "final_reply": "Tracking number: XYZ001."}
scenario a_snapshot_after_every_turn_lets_a_new_process_resume · 3349.3ms
turn 1 · 1363.2ms · 314 in / 44 out · asked for: check_order
model live · 1362.4ms (model provider 1136.8 · library 225.7) · 314 in / 44 out · asked for: check_order
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhat's the status of order A100?
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length421
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "What's the status of order A100?",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "check_order",
        "description": "Check the status of an order by id.",
        "parameters": {
          "properties": {
            "order_id": {
              "type": "string"
            }
          },
          "required": [
            "order_id"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:57:31 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 8a50fe9452625079391cf0ce7a3e0c56.cloudfront.net (CloudFront)
x-amz-cf-idEDqSncHzP3gDBACDqD8uSP8BzS-3MZADBh1Ra9gQrWHzjk80qSzpTg==
x-amz-cf-popDEN52-P2
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-idfdd4af1a5538dde7f04b7db0da6c185f
{
  "id": "f70f2eb2-ebab-435b-b298-36d03dde7b9d",
  "object": "chat.completion",
  "created": 1789336651,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "Simple tool call.",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_JHuUieddcVKfNp8lP1953813",
            "type": "function",
            "function": {
              "name": "check_order",
              "arguments": "{\"order_id\": \"A100\"}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 314,
    "completion_tokens": 44,
    "total_tokens": 358,
    "prompt_tokens_details": {
      "cached_tokens": 128
    },
    "completion_tokens_details": {
      "reasoning_tokens": 4
    },
    "prompt_cache_hit_tokens": 128,
    "prompt_cache_miss_tokens": 186
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
check_order({"order_id": "A100"})
tool check_order · 0.7ms · given: order_id=A100 · returned: order A100: shipped, tracking XYZ001
args {"order_id": "A100"}
result {"value": "order A100: shipped, tracking XYZ001"}
turn 2 · 766.6ms · 379 in / 16 out · responded with: Order A100 has shipped. Tracking number: XYZ001.
model live · 766.6ms (model provider 758.8 · library 7.8) · 379 in / 16 out · responded with: Order A100 has shipped. Tracking number: XYZ001.
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhat's the status of order A100?
[2]ai
check_order({"order_id": "A100"})
[3]toolorder A100: shipped, tracking XYZ001
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length760
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "What's the status of order A100?",
      "role": "user"
    },
    {
      "content": null,
      "role": "assistant",
      "tool_calls": [
        {
          "type": "function",
          "id": "call_00_JHuUieddcVKfNp8lP1953813",
          "function": {
            "name": "check_order",
            "arguments": "{\"order_id\": \"A100\"}"
          }
        }
      ],
      "reasoning_content": "Simple tool call."
    },
    {
      "content": "order A100: shipped, tracking XYZ001",
      "role": "tool",
      "tool_call_id": "call_00_JHuUieddcVKfNp8lP1953813"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "check_order",
        "description": "Check the status of an order by id.",
        "parameters": {
          "properties": {
            "order_id": {
              "type": "string"
            }
          },
          "required": [
            "order_id"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:57:32 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 8df77e01b229d5d8502d6471c086aeb2.cloudfront.net (CloudFront)
x-amz-cf-idxcXHPzK8DxMotJd2Q9FCUOfvhBCAIV_bmD8-GyIOuyBvmuomaX1ONw==
x-amz-cf-popDEN53-P4
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-iddab01c11f25e53cf9e0b038adc54a08e
{
  "id": "2876077d-36de-4e86-ae59-852637a3adb4",
  "object": "chat.completion",
  "created": 1789336652,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Order A100 has shipped. Tracking number: XYZ001.",
        "reasoning_content": "Answer briefly."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 379,
    "completion_tokens": 16,
    "total_tokens": 395,
    "prompt_tokens_details": {
      "cached_tokens": 128
    },
    "completion_tokens_details": {
      "reasoning_tokens": 3
    },
    "prompt_cache_hit_tokens": 128,
    "prompt_cache_miss_tokens": 251
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiOrder A100 has shipped. Tracking number: XYZ001.
snapshot_written open file {"path": "out/ch31_stop_resume/a_snapshot_after_every_turn_lets_a_new_process_resume/order-support-run.jsonl", "turn": 2}
turn 3 · 1218.0ms · 399 in / 4 out · responded with: XYZ001.
model live · 1218.0ms (model provider 1211.1 · library 7.0) · 399 in / 4 out · responded with: XYZ001.
context sent — 6 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhat's the status of order A100?
[2]ai
check_order({"order_id": "A100"})
[3]toolorder A100: shipped, tracking XYZ001
[4]aiOrder A100 has shipped. Tracking number: XYZ001.
[5]humanAnd what's the tracking number?
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length862
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "What's the status of order A100?",
      "role": "user"
    },
    {
      "content": null,
      "role": "assistant",
      "tool_calls": [
        {
          "type": "function",
          "id": "call_00_JHuUieddcVKfNp8lP1953813",
          "function": {
            "name": "check_order",
            "arguments": "{\"order_id\": \"A100\"}"
          }
        }
      ]
    },
    {
      "content": "order A100: shipped, tracking XYZ001",
      "role": "tool",
      "tool_call_id": "call_00_JHuUieddcVKfNp8lP1953813"
    },
    {
      "content": "Order A100 has shipped. Tracking number: XYZ001.",
      "role": "assistant"
    },
    {
      "content": "And what's the tracking number?",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "check_order",
        "description": "Check the status of an order by id.",
        "parameters": {
          "properties": {
            "order_id": {
              "type": "string"
            }
          },
          "required": [
            "order_id"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:57:33 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 2b6f0b2cd8495233ea20114fbb247772.cloudfront.net (CloudFront)
x-amz-cf-idM3r5Guc-MptwaYuep_dTqNgiPs4gGbB3f_TVi4rVjZ7uy7cchNMBmQ==
x-amz-cf-popDEN53-P3
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id350b64a2d44122d9ae1983f2611e9a2f
{
  "id": "142daaf5-5663-4793-9843-2b5a123c69ac",
  "object": "chat.completion",
  "created": 1789336653,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "XYZ001.",
        "reasoning_content": ""
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 399,
    "completion_tokens": 4,
    "total_tokens": 403,
    "prompt_tokens_details": {
      "cached_tokens": 256
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    },
    "prompt_cache_hit_tokens": 256,
    "prompt_cache_miss_tokens": 143
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiXYZ001.
resumed_in_a_new_process open file {"path": "out/ch31_stop_resume/a_snapshot_after_every_turn_lets_a_new_process_resume/order-support-run.jsonl", "resumed_from_turn": 2, "final_message_count": 7, "final_reply": "XYZ001."}
scenario snapshotting_mid_turn_would_orphan_a_tool_call
scenario snapshotting_mid_turn_would_orphan_a_tool_call · 0.5ms
turn 1 · 0.4ms · asked for: check_order
model mock · 0.2ms · asked for: check_order
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhat's the status of order A100?
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
tools declared to the mock model {"names": ["check_order"], "consulted": false}
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]ai
check_order({"order_id": "A100"})
tool check_order · 0.1ms · given: order_id=A100 · returned: order A100: shipped, tracking XYZ001
args {"order_id": "A100"}
result {"value": "order A100: shipped, tracking XYZ001"}
bad_snapshot_written_mid_turn open file {"path": "out/ch31_stop_resume/snapshotting_mid_turn_would_orphan_a_tool_call/bad-timing-run.jsonl"}
resume_check {"checked": false, "reason": "not applicable under mock"}
scenario snapshotting_mid_turn_would_orphan_a_tool_call · 1723.7ms
turn 1 · 1372.0ms · 314 in / 58 out · asked for: check_order
model live · 1370.5ms (model provider 1362.0 · library 8.6) · 314 in / 58 out · asked for: check_order
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhat's the status of order A100?
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length421
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "What's the status of order A100?",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "check_order",
        "description": "Check the status of an order by id.",
        "parameters": {
          "properties": {
            "order_id": {
              "type": "string"
            }
          },
          "required": [
            "order_id"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:57:34 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 75249decb514179d058bfd4c743e49a0.cloudfront.net (CloudFront)
x-amz-cf-iddEuM9TSi_bSNkQ22PmR_sdQqdzGZhIruHuIyFE5-rxBUbnV1IASj8A==
x-amz-cf-popDEN53-P6
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id1480b5aaec6c25ae6df1cdba06fe9036
{
  "id": "22f8ee03-b2c9-48cd-b3ad-7bd713ae789a",
  "object": "chat.completion",
  "created": 1789336654,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "The user wants the status of order A100. I should call the check_order tool.",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_eFqeBjI72gB8aJ0MLcFK6662",
            "type": "function",
            "function": {
              "name": "check_order",
              "arguments": "{\"order_id\": \"A100\"}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 314,
    "completion_tokens": 58,
    "total_tokens": 372,
    "prompt_tokens_details": {
      "cached_tokens": 128
    },
    "completion_tokens_details": {
      "reasoning_tokens": 18
    },
    "prompt_cache_hit_tokens": 128,
    "prompt_cache_miss_tokens": 186
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
check_order({"order_id": "A100"})
tool check_order · 0.7ms · given: order_id=A100 · returned: order A100: shipped, tracking XYZ001
args {"order_id": "A100"}
result {"value": "order A100: shipped, tracking XYZ001"}
bad_snapshot_written_mid_turn open file {"path": "out/ch31_stop_resume/snapshotting_mid_turn_would_orphan_a_tool_call/bad-timing-run.jsonl"}
model live · 351.5ms (model provider 340.5 · library 10.9)
context sent — 3 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhat's the status of order A100?
[2]ai
check_order({"order_id": "A100"})
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (7)
temperature, max_tokens, top_p, stop, seed, tools, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length390
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "What's the status of order A100?",
      "role": "user"
    },
    {
      "content": null,
      "role": "assistant",
      "tool_calls": [
        {
          "type": "function",
          "id": "call_00_eFqeBjI72gB8aJ0MLcFK6662",
          "function": {
            "name": "check_order",
            "arguments": "{\"order_id\": \"A100\"}"
          }
        }
      ]
    }
  ],
  "model": "deepseek-flash",
  "stream": false
}
wire response
status
400
headers (14)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-length264
content-typeapplication/octet-stream
dateSun, 13 Sep 2026 21:57:35 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
varyorigin, access-control-request-method, access-control-request-headers
via1.1 5257b3c7acd3727a389946b312557ff2.cloudfront.net (CloudFront)
x-amz-cf-idB4c1mxlZF6JNNSmfq8cktiukc8uNGtII9oMk8PAGpGCgm_jj54z5aQ==
x-amz-cf-popDEN52-P2
x-cacheError from cloudfront
x-content-type-optionsnosniff
x-ds-trace-idd96959ece544b1f73c749caeaf1571a6
{
  "error": {
    "message": "An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. (insufficient tool messages following tool_calls message)",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_request_error"
  }
}
resume_check {"accepted": false, "error": "Error code: 400 - {'error': {'message': \"An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. (insufficient tool messages following tool_calls message)\", 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_request_error'}}"}
scenario a_crash_before_the_next_snapshot_loses_at_most_one_turn
scenario a_crash_before_the_next_snapshot_loses_at_most_one_turn · 1.0ms
turn 1 · 0.3ms · asked for: check_order
model mock · 0.2ms · asked for: check_order
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhat's the status of order A100?
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
tools declared to the mock model {"names": ["check_order"], "consulted": false}
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]ai
check_order({"order_id": "A100"})
tool check_order · 0.1ms · given: order_id=A100 · returned: order A100: shipped, tracking XYZ001
args {"order_id": "A100"}
result {"value": "order A100: shipped, tracking XYZ001"}
turn 2 · 0.1ms · responded with: Order A100 has shipped.
model mock · 0.1ms · responded with: Order A100 has shipped.
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhat's the status of order A100?
[2]ai
check_order({"order_id": "A100"})
[3]toolorder A100: shipped, tracking XYZ001
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
tools declared to the mock model {"names": ["check_order"], "consulted": false}
context ignored by the mock model {"messages": 4, "roles": ["system", "human", "ai", "tool"]}
reply
rolecontent
[0]aiOrder A100 has shipped.
turn 3 · 0.2ms · responded with: No, that's everything.
model mock · 0.1ms · responded with: No, that's everything.
context sent — 6 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhat's the status of order A100?
[2]ai
check_order({"order_id": "A100"})
[3]toolorder A100: shipped, tracking XYZ001
[4]aiOrder A100 has shipped.
[5]humanAnything else I should know?
context ignored by the mock model {"messages": 6, "roles": ["system", "human", "ai", "tool", "ai", "human"]}
reply
rolecontent
[0]aiNo, that's everything.
recovery_point {"recovered_turn": 2, "turn_three_was_lost": true}
turn 3 · 0.1ms · responded with: No, that's everything.
model mock · 0.1ms · responded with: No, that's everything.
context sent — 6 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhat's the status of order A100?
[2]ai
check_order({"order_id": "A100"})
[3]toolorder A100: shipped, tracking XYZ001
[4]aiOrder A100 has shipped.
[5]humanAnything else I should know?
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
tools declared to the mock model {"names": ["check_order"], "consulted": false}
context ignored by the mock model {"messages": 6, "roles": ["system", "human", "ai", "tool", "ai", "human"]}
reply
rolecontent
[0]aiNo, that's everything.
turn_three_redone_cleanly open file {"path": "out/ch31_stop_resume/a_crash_before_the_next_snapshot_loses_at_most_one_turn/crash-mid-turn-run.jsonl"}
scenario a_crash_before_the_next_snapshot_loses_at_most_one_turn · 5983.7ms
turn 1 · 1392.1ms · 314 in / 40 out · asked for: check_order
model live · 1391.6ms (model provider 1382.6 · library 9.0) · 314 in / 40 out · asked for: check_order
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhat's the status of order A100?
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length421
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "What's the status of order A100?",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "check_order",
        "description": "Check the status of an order by id.",
        "parameters": {
          "properties": {
            "order_id": {
              "type": "string"
            }
          },
          "required": [
            "order_id"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:57:36 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 0ce5ea6368e3c7ea57962fd7b4c5fe44.cloudfront.net (CloudFront)
x-amz-cf-idYTwkMj-JdbGdMaQ2YMjjVkx22wMffRpHDagWgKPuY2qq4UF3rMpopw==
x-amz-cf-popDEN53-P4
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id65813c5f2869ee3e78b60bf32d32625d
{
  "id": "37249b42-e3b3-45e9-b89c-43eea524381f",
  "object": "chat.completion",
  "created": 1789336656,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_ET_W7L8lSETDGbtQJtwiOJi1464",
            "type": "function",
            "function": {
              "name": "check_order",
              "arguments": "{\"order_id\": \"A100\"}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 314,
    "completion_tokens": 40,
    "total_tokens": 354,
    "prompt_tokens_details": {
      "cached_tokens": 128
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    },
    "prompt_cache_hit_tokens": 128,
    "prompt_cache_miss_tokens": 186
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
check_order({"order_id": "A100"})
tool check_order · 0.5ms · given: order_id=A100 · returned: order A100: shipped, tracking XYZ001
args {"order_id": "A100"}
result {"value": "order A100: shipped, tracking XYZ001"}
turn 2 · 700.5ms · 375 in / 12 out · responded with: Order A100 is shipped — tracking number XYZ001.
model live · 700.5ms (model provider 691.5 · library 8.9) · 375 in / 12 out · responded with: Order A100 is shipped — tracking number XYZ001.
context sent — 4 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhat's the status of order A100?
[2]ai
check_order({"order_id": "A100"})
[3]toolorder A100: shipped, tracking XYZ001
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length726
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "What's the status of order A100?",
      "role": "user"
    },
    {
      "content": null,
      "role": "assistant",
      "tool_calls": [
        {
          "type": "function",
          "id": "call_00_ET_W7L8lSETDGbtQJtwiOJi1464",
          "function": {
            "name": "check_order",
            "arguments": "{\"order_id\": \"A100\"}"
          }
        }
      ]
    },
    {
      "content": "order A100: shipped, tracking XYZ001",
      "role": "tool",
      "tool_call_id": "call_00_ET_W7L8lSETDGbtQJtwiOJi1464"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "check_order",
        "description": "Check the status of an order by id.",
        "parameters": {
          "properties": {
            "order_id": {
              "type": "string"
            }
          },
          "required": [
            "order_id"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:57:37 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 46a64c5c80478abcfef022bde73d204e.cloudfront.net (CloudFront)
x-amz-cf-idDn5WAwthHwymS8Bljg94cpY5-BqeLNjWx6WLoB9y9OauipKkbwk92w==
x-amz-cf-popDEN53-P6
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id29d53e118651de1cea8a1bbb3dd4ed82
{
  "id": "9af6d715-8967-4986-9dbc-886492e7168d",
  "object": "chat.completion",
  "created": 1789336657,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Order A100 is shipped \u2014 tracking number XYZ001.",
        "reasoning_content": ""
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 375,
    "completion_tokens": 12,
    "total_tokens": 387,
    "prompt_tokens_details": {
      "cached_tokens": 128
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    },
    "prompt_cache_hit_tokens": 128,
    "prompt_cache_miss_tokens": 247
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiOrder A100 is shipped — tracking number XYZ001.
turn 3 · 2303.6ms · 133 in / 262 out · responded with: I only have the order status: shipped, tracking XYZ001. I don’t have carrier, delivery est... (111 more characters)
model live · 2303.6ms (model provider 2295.4 · library 8.2) · 133 in / 262 out · responded with: I only have the order status: shipped, tracking XYZ001. I don’t have carrier, delivery est... (111 more characters)
context sent — 6 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhat's the status of order A100?
[2]ai
check_order({"order_id": "A100"})
[3]toolorder A100: shipped, tracking XYZ001
[4]aiOrder A100 is shipped — tracking number XYZ001.
[5]humanAnything else I should know?
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (7)
temperature, max_tokens, top_p, stop, seed, tools, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length651
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "What's the status of order A100?",
      "role": "user"
    },
    {
      "content": null,
      "role": "assistant",
      "tool_calls": [
        {
          "type": "function",
          "id": "call_00_ET_W7L8lSETDGbtQJtwiOJi1464",
          "function": {
            "name": "check_order",
            "arguments": "{\"order_id\": \"A100\"}"
          }
        }
      ]
    },
    {
      "content": "order A100: shipped, tracking XYZ001",
      "role": "tool",
      "tool_call_id": "call_00_ET_W7L8lSETDGbtQJtwiOJi1464"
    },
    {
      "content": "Order A100 is shipped \u2014 tracking number XYZ001.",
      "role": "assistant"
    },
    {
      "content": "Anything else I should know?",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "stream": false
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:57:38 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 b1a94c3ca6429736112e2213a359c78a.cloudfront.net (CloudFront)
x-amz-cf-idUxGUBtNO0dfvSPnfopMA1sIa0nD_0J_P_-9nlVXXQb0kqWZhbbfFJg==
x-amz-cf-popDEN53-P3
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id010b2c2eaca26b45fdb32726eda42bec
{
  "id": "54efbc90-f820-442c-ae58-11e6a6cc0738",
  "object": "chat.completion",
  "created": 1789336658,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "I only have the order status: shipped, tracking XYZ001. I don\u2019t have carrier, delivery estimate, or item details from that lookup. For location or delivery timing, use tracking XYZ001 with the carrier.",
        "reasoning_content": "We need answer. User asks \"Anything else I should know?\" We have only order status via tool. Need see if can check more? We have check_order tool only? We can use tools if given. The previous tool check_order returned shipped, tracking XYZ001. User asks anything else. We don't have additional info. We should be honest: I only have status and tracking. Could suggest carrier tracking for details. Maybe ask if they want me to do something else. But tools only check_order? We can call again? No need. Need answer briefly plainly. We don't know carrier, delivery date, items, etc. So say I don't have more details from the order lookup. For delivery estimates or current location, check with carrier using tracking XYZ001. If you want, I can look up another order. But maybe no tool to look up more. We can say I can't check more with what I have. Since we have check_order, maybe call with A100 again? Same result. Not useful. We should answer. Ensure no hallucination."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 133,
    "completion_tokens": 262,
    "total_tokens": 395,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 217
    },
    "prompt_cache_hit_tokens": 0,
    "prompt_cache_miss_tokens": 133
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiI only have the order status: shipped, tracking XYZ001. I don’t have carrier, delivery estimate, or item details from that lookup. For location or delivery timing, use tracking XYZ001 with the carrier.
recovery_point {"recovered_turn": 2, "turn_three_was_lost": true}
turn 3 · 1586.1ms · 397 in / 105 out · responded with: Not from what I can see — the only detail I have is that it's shipped, with tracking XYZ00... (197 more characters)
model live · 1586.1ms (model provider 1578.1 · library 8.0) · 397 in / 105 out · responded with: Not from what I can see — the only detail I have is that it's shipped, with tracking XYZ00... (197 more characters)
context sent — 6 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanWhat's the status of order A100?
[2]ai
check_order({"order_id": "A100"})
[3]toolorder A100: shipped, tracking XYZ001
[4]aiOrder A100 is shipped — tracking number XYZ001.
[5]humanAnything else I should know?
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length866
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "What's the status of order A100?",
      "role": "user"
    },
    {
      "content": null,
      "role": "assistant",
      "tool_calls": [
        {
          "type": "function",
          "id": "call_00_ET_W7L8lSETDGbtQJtwiOJi1464",
          "function": {
            "name": "check_order",
            "arguments": "{\"order_id\": \"A100\"}"
          }
        }
      ]
    },
    {
      "content": "order A100: shipped, tracking XYZ001",
      "role": "tool",
      "tool_call_id": "call_00_ET_W7L8lSETDGbtQJtwiOJi1464"
    },
    {
      "content": "Order A100 is shipped \u2014 tracking number XYZ001.",
      "role": "assistant"
    },
    {
      "content": "Anything else I should know?",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "check_order",
        "description": "Check the status of an order by id.",
        "parameters": {
          "properties": {
            "order_id": {
              "type": "string"
            }
          },
          "required": [
            "order_id"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:57:40 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 f6327093dd59f54131617ea3ab04bd94.cloudfront.net (CloudFront)
x-amz-cf-idfsCiCiu3Qm04pMOEcrOUzGtmIOsM2Wt3AmCPb7g_N4bz5VAhchle9A==
x-amz-cf-popDEN53-P2
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-ide888a39b3c912e3e6447d6fdbefd0057
{
  "id": "e21b4559-50de-44f8-91b7-b2aee053b616",
  "object": "chat.completion",
  "created": 1789336660,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Not from what I can see \u2014 the only detail I have is that it's shipped, with tracking XYZ001. I don't have info on the carrier, delivery estimate, or items in the order. If you need those, the carrier's tracking page for XYZ001 or your order confirmation email would be the place to look.",
        "reasoning_content": "The user asks \"Anything else I should know?\" I only have the tool output: order A100 shipped, tracking XYZ001. I shouldn't invent details like delivery date. Be plain."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 397,
    "completion_tokens": 105,
    "total_tokens": 502,
    "prompt_tokens_details": {
      "cached_tokens": 256
    },
    "completion_tokens_details": {
      "reasoning_tokens": 38
    },
    "prompt_cache_hit_tokens": 256,
    "prompt_cache_miss_tokens": 141
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiNot from what I can see — the only detail I have is that it's shipped, with tracking XYZ001. I don't have info on the carrier, delivery estimate, or items in the order. If you need those, the carrier's tracking page for XYZ001 or your order confirmation email would be the place to look.
turn_three_redone_cleanly open file {"path": "out/ch31_stop_resume/a_crash_before_the_next_snapshot_loses_at_most_one_turn/crash-mid-turn-run.jsonl"}
scenario separate_run_ids_do_not_collide
scenario separate_run_ids_do_not_collide · 0.5ms
turn 1 · 0.2ms · responded with: Order A100 has shipped.
model mock · 0.2ms · responded with: Order A100 has shipped.
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanTrack order A100.
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
tools declared to the mock model {"names": ["check_order"], "consulted": false}
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]aiOrder A100 has shipped.
turn 1 · 0.1ms · responded with: Order B200 is processing.
model mock · 0.1ms · responded with: Order B200 is processing.
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanTrack order B200.
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
tools declared to the mock model {"names": ["check_order"], "consulted": false}
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]aiOrder B200 is processing.
isolation_check {"run_a_mentions_a100": true, "run_a_mentions_b200": false, "run_b_mentions_b200": true, "run_b_mentions_a100": false}
scenario separate_run_ids_do_not_collide · 2178.1ms
turn 1 · 1069.7ms · 310 in / 57 out · asked for: check_order
model live · 1069.3ms (model provider 1062.4 · library 6.9) · 310 in / 57 out · asked for: check_order
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanTrack order A100.
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length406
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "Track order A100.",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "check_order",
        "description": "Check the status of an order by id.",
        "parameters": {
          "properties": {
            "order_id": {
              "type": "string"
            }
          },
          "required": [
            "order_id"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:57:42 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 5dcf09eaf65257abe85ddc5988a25c4e.cloudfront.net (CloudFront)
x-amz-cf-idSdPmwMtSMzEJWaaiXlLFHG2o03-w5GhviTT55I6K_IUj2XQrbtU3wQ==
x-amz-cf-popDEN52-P3
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id1a875f02567e1e463ace4db72523b12c
{
  "id": "143f7a2b-fa06-4e28-a0cf-ca8ea5c3b6e8",
  "object": "chat.completion",
  "created": 1789336662,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "The user wants to track order A100. I should call the check_order tool.",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_LfzPbRpsIPdiWxWEcTnO2205",
            "type": "function",
            "function": {
              "name": "check_order",
              "arguments": "{\"order_id\": \"A100\"}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 310,
    "completion_tokens": 57,
    "total_tokens": 367,
    "prompt_tokens_details": {
      "cached_tokens": 128
    },
    "completion_tokens_details": {
      "reasoning_tokens": 17
    },
    "prompt_cache_hit_tokens": 128,
    "prompt_cache_miss_tokens": 182
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
check_order({"order_id": "A100"})
tool check_order · 0.3ms · given: order_id=A100 · returned: order A100: shipped, tracking XYZ001
args {"order_id": "A100"}
result {"value": "order A100: shipped, tracking XYZ001"}
turn 1 · 1107.4ms · 310 in / 57 out · asked for: check_order
model live · 1107.0ms (model provider 1098.7 · library 8.3) · 310 in / 57 out · asked for: check_order
context sent — 2 message(s)
rolecontent
[0]systemYou answer briefly and plainly. Use the tools you are given.
[1]humanTrack order B200.
declared tools (1)
tooldescriptionschema
check_orderCheck the status of an order by id.{"description": "Check the status of an order by id.", "properties": {"order_id": {"title": "Order Id", "type": "string"}}, "required": ["order_id"], "title": "check_order", "type": "object"}
wire request
attempt
1
method
POST
url
https://api.deepseek.com/v1/chat/completions
defaulted (6)
temperature, max_tokens, top_p, stop, seed, tool_choice
headers (18)
show
acceptapplication/json
accept-encodinggzip, deflate, zstd
authorizationnot recorded
connectionkeep-alive
content-length406
content-typeapplication/json
hostapi.deepseek.com
user-agentOpenAI/Python 3.6.0
x-stainless-archarm64
x-stainless-asyncfalse
x-stainless-langpython
x-stainless-osMacOS
x-stainless-package-version3.6.0
x-stainless-raw-responsetrue
x-stainless-read-timeout60.0
x-stainless-retry-count0
x-stainless-runtimeCPython
x-stainless-runtime-version3.14.7
{
  "messages": [
    {
      "content": "You answer briefly and plainly. Use the tools you are given.",
      "role": "system"
    },
    {
      "content": "Track order B200.",
      "role": "user"
    }
  ],
  "model": "deepseek-flash",
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "check_order",
        "description": "Check the status of an order by id.",
        "parameters": {
          "properties": {
            "order_id": {
              "type": "string"
            }
          },
          "required": [
            "order_id"
          ],
          "type": "object"
        }
      }
    }
  ]
}
wire response
status
200
headers (15)
show
access-control-allow-credentialstrue
connectionkeep-alive
content-encodinggzip
content-typeapplication/json
dateSun, 13 Sep 2026 21:57:43 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 8ebed69b9bff6cc42b0f52303f299b96.cloudfront.net (CloudFront)
x-amz-cf-idkDClSvnCpcbTyNnV5dsAFIEbk9ti5OyP1arIv32H-UD87ECKRARceg==
x-amz-cf-popDEN53-P2
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-idee5f622403bc5c08418428cb98b3dd70
{
  "id": "53909ac8-25e5-4b36-9454-97e1d8298fcf",
  "object": "chat.completion",
  "created": 1789336663,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "The user wants to track order B200. I should use the check_order tool.",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_35EXvpYujFIfIR5b6y8x8239",
            "type": "function",
            "function": {
              "name": "check_order",
              "arguments": "{\"order_id\": \"B200\"}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 310,
    "completion_tokens": 57,
    "total_tokens": 367,
    "prompt_tokens_details": {
      "cached_tokens": 128
    },
    "completion_tokens_details": {
      "reasoning_tokens": 17
    },
    "prompt_cache_hit_tokens": 128,
    "prompt_cache_miss_tokens": 182
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
check_order({"order_id": "B200"})
tool check_order · 0.3ms · given: order_id=B200 · returned: order B200: shipped, tracking XYZ001
args {"order_id": "B200"}
result {"value": "order B200: shipped, tracking XYZ001"}
isolation_check {"run_a_mentions_a100": true, "run_a_mentions_b200": false, "run_b_mentions_b200": true, "run_b_mentions_a100": false}