ch34_checkpoint

show:
mock turns=0 · messages=0
live turns=0 · messages=0
scenario a_checkpointer_resumes_a_thread_across_separate_invoke_calls
scenario a_checkpointer_resumes_a_thread_across_separate_invoke_calls · 4.6ms
turn 1 · 0.4ms · responded with: This is turn one.
model mock · 0.3ms · responded with: This is turn one.
context sent — 2 message(s)
rolecontent
[0]systemAnswer briefly.
[1]humanSay something.
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]aiThis is turn one.
checkpoint saved after turn 1 · thread_id=resume-demo · 0.1ms
held_by_the_checkpointer {"message_count": 3, "roles": ["system", "human", "ai"]}
checkpoint read back before turn 2 -- what it will load · thread_id=resume-demo · 0.1ms
held_by_the_checkpointer {"message_count": 3, "roles": ["system", "human", "ai"]}
turn 2 · 0.2ms · responded with: You already asked me something, in turn one.
model mock · 0.2ms · responded with: You already asked me something, in turn one.
context sent — 4 message(s)
rolecontent
[0]systemAnswer briefly.
[1]humanSay something.
[2]aiThis is turn one.
[3]humanWhat did I just say?
context ignored by the mock model {"messages": 4, "roles": ["system", "human", "ai", "human"]}
reply
rolecontent
[0]aiYou already asked me something, in turn one.
checkpoint saved after turn 2 · thread_id=resume-demo · 0.1ms
held_by_the_checkpointer {"message_count": 5, "roles": ["system", "human", "ai", "human", "ai"]}
second_call_saw_the_first {"second_call_input_message_count": 1, "full_history_length": 5, "final_reply": "You already asked me something, in turn one."}
scenario a_checkpointer_resumes_a_thread_across_separate_invoke_calls · 3754.5ms
turn 1 · 1492.9ms · 36 in / 139 out · responded with: Something.
model live · 1492.8ms (model provider 1306.6 · library 186.3) · 36 in / 139 out · responded with: Something.
context sent — 2 message(s)
rolecontent
[0]systemAnswer briefly.
[1]humanSay something.
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-length143
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": "Answer briefly.",
      "role": "system"
    },
    {
      "content": "Say something.",
      "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:58:10 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 b35c566c5c237e7090b19170d36f7ad2.cloudfront.net (CloudFront)
x-amz-cf-idh9mbb_we_mkRQFvMwQ0h33GnWJi5JfYLoRjpEjrV1yLuZftvBShd7Q==
x-amz-cf-popDEN53-P3
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-idc66fe9aff57de3a48912768c7ae7cae4
{
  "id": "2c1a3eaf-50df-4122-bc98-538240d36a0b",
  "object": "chat.completion",
  "created": 1789336690,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Something.",
        "reasoning_content": "We need answer briefly. User says \"Say something.\" Need respond something. Could be anything. We need comply briefly. Maybe \"Something.\" That's witty. But maybe they want actual. We can say \"Hello! How can I help?\" But instruction \"Say something.\" The shortest appropriate: \"Something.\" But maybe too cheeky. Desired oververbosity 5 but user asks briefly? System says answer briefly. So final should be brief. Could say \"Something.\" That's literal. Maybe \"Hello! What's on your mind?\" But \"Say something\" implies just output. I'll do \"Something.\" Maybe with period. Ensure no analysis. Final. "
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 36,
    "completion_tokens": 139,
    "total_tokens": 175,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 136
    },
    "prompt_cache_hit_tokens": 0,
    "prompt_cache_miss_tokens": 36
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiSomething.
checkpoint saved after turn 1 · thread_id=resume-demo · 0.5ms
held_by_the_checkpointer {"message_count": 3, "roles": ["system", "human", "ai"]}
checkpoint read back before turn 2 -- what it will load · thread_id=resume-demo · 0.3ms
held_by_the_checkpointer {"message_count": 3, "roles": ["system", "human", "ai"]}
turn 2 · 2252.9ms · 48 in / 204 out · responded with: You just asked, “What did I just say?” Before that, you said, “Say something.”
model live · 2252.9ms (model provider 2244.3 · library 8.6) · 48 in / 204 out · responded with: You just asked, “What did I just say?” Before that, you said, “Say something.”
context sent — 4 message(s)
rolecontent
[0]systemAnswer briefly.
[1]humanSay something.
[2]aiSomething.
[3]humanWhat did I just say?
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-length870
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": "Answer briefly.",
      "role": "system"
    },
    {
      "content": "Say something.",
      "role": "user"
    },
    {
      "content": "Something.",
      "role": "assistant",
      "reasoning_content": "We need answer briefly. User says \"Say something.\" Need respond something. Could be anything. We need comply briefly. Maybe \"Something.\" That's witty. But maybe they want actual. We can say \"Hello! How can I help?\" But instruction \"Say something.\" The shortest appropriate: \"Something.\" But maybe too cheeky. Desired oververbosity 5 but user asks briefly? System says answer briefly. So final should be brief. Could say \"Something.\" That's literal. Maybe \"Hello! What's on your mind?\" But \"Say something\" implies just output. I'll do \"Something.\" Maybe with period. Ensure no analysis. Final. "
    },
    {
      "content": "What did I just say?",
      "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:58:11 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 2870015ca1c40ef5342e0ec500437a72.cloudfront.net (CloudFront)
x-amz-cf-idwZLBYKqdx9SJqLNHGnw-bT8eJjmoa-sYLKiS509sBUyhM2qAAsnCGw==
x-amz-cf-popDEN53-P6
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id89c5b03526d2a12152d1da5d501e5e48
{
  "id": "27d13497-23e5-42f6-8cfc-dd02f8ae2732",
  "object": "chat.completion",
  "created": 1789336691,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "You just asked, \u201cWhat did I just say?\u201d Before that, you said, \u201cSay something.\u201d",
        "reasoning_content": "We need answer. User asks \"What did I just say?\" Need respond accurately. Conversation: User: \"Say something.\" Assistant: \"Something.\" User: \"What did I just say?\" So the user just said \"What did I just say?\" But likely they refer to prior message? Need parse. They ask what did I just say? I should answer: You just asked, \"What did I just say?\" Or if they mean before that, you said \"Say something.\" Wait timeline: User said \"Say something.\" Assistant said \"Something.\" User said \"What did I just say?\" So the most recent thing user said is \"What did I just say?\" The immediately previous user utterance before that was \"Say something.\" So answer could clarify: \"Your last message was 'What did I just say?' Before that, you said 'Say something.'\" That addresses ambiguity. Keep brief."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 48,
    "completion_tokens": 204,
    "total_tokens": 252,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 182
    },
    "prompt_cache_hit_tokens": 0,
    "prompt_cache_miss_tokens": 48
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiYou just asked, “What did I just say?” Before that, you said, “Say something.”
checkpoint saved after turn 2 · thread_id=resume-demo · 0.3ms
held_by_the_checkpointer {"message_count": 5, "roles": ["system", "human", "ai", "human", "ai"]}
second_call_saw_the_first {"second_call_input_message_count": 1, "full_history_length": 5, "final_reply": "You just asked, \u201cWhat did I just say?\u201d Before that, you said, \u201cSay something.\u201d"}
scenario two_thread_ids_never_see_each_others_history
scenario two_thread_ids_never_see_each_others_history · 2.5ms
turn 2 · 0.2ms · responded with: noted.
model mock · 0.2ms · responded with: noted.
context sent — 2 message(s)
rolecontent
[0]systemAnswer briefly.
[1]humanMy order is A100.
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]ainoted.
checkpoint saved for thread-a · thread_id=thread-a · 0.1ms
held_by_the_checkpointer {"message_count": 3, "roles": ["system", "human", "ai"]}
checkpoint thread-b before its own first call -- empty · thread_id=thread-b · 0.0ms
held_by_the_checkpointer {"message_count": 0, "roles": []}
turn 1 · 0.2ms · responded with: noted.
model mock · 0.1ms · responded with: noted.
context sent — 1 message(s)
rolecontent
[0]humanWhat's my order number?
context ignored by the mock model {"messages": 1, "roles": ["human"]}
reply
rolecontent
[0]ainoted.
thread_b_starts_empty {"thread_b_message_count_before_reply": 1, "thread_b_never_saw_a100": true}
scenario two_thread_ids_never_see_each_others_history · 3420.8ms
turn 2 · 1595.1ms · 39 in / 78 out · responded with: Got it — order A100. How can I help?
model live · 1595.0ms (model provider 1586.3 · library 8.7) · 39 in / 78 out · responded with: Got it — order A100. How can I help?
context sent — 2 message(s)
rolecontent
[0]systemAnswer briefly.
[1]humanMy order is 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-length146
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": "Answer briefly.",
      "role": "system"
    },
    {
      "content": "My order is A100.",
      "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:58:13 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 d9978c4c79926d2f68f210859236f550.cloudfront.net (CloudFront)
x-amz-cf-idxIechoqj6z4pVjBhJ_kB9cAba_1d4JOl8stmC_oZMWpnuxJVCNI8_w==
x-amz-cf-popDEN53-P2
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id98292fbc1b96603cfe8ba7a6abbb4ec9
{
  "id": "df82fd82-cc7f-41f7-a6fd-71aae8745c87",
  "object": "chat.completion",
  "created": 1789336693,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Got it \u2014 order A100. How can I help?",
        "reasoning_content": "We need answer briefly. User says \"My order is A100.\" We need infer? Maybe they're providing order ID. Need respond appropriately. Could be asking? No question. We should acknowledge and ask how can help. Brief. Maybe \"Got it \u2014 order A100. How can I help?\" Ensure no extra."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 39,
    "completion_tokens": 78,
    "total_tokens": 117,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 65
    },
    "prompt_cache_hit_tokens": 0,
    "prompt_cache_miss_tokens": 39
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiGot it — order A100. How can I help?
checkpoint saved for thread-a · thread_id=thread-a · 0.3ms
held_by_the_checkpointer {"message_count": 3, "roles": ["system", "human", "ai"]}
checkpoint thread-b before its own first call -- empty · thread_id=thread-b · 0.0ms
held_by_the_checkpointer {"message_count": 0, "roles": []}
turn 1 · 1819.6ms · 36 in / 191 out · responded with: I don’t have access to your order details, so I can’t look up your order number. You can u... (286 more characters)
model live · 1819.5ms (model provider 1812.0 · library 7.5) · 36 in / 191 out · responded with: I don’t have access to your order details, so I can’t look up your order number. You can u... (286 more characters)
context sent — 1 message(s)
rolecontent
[0]humanWhat's my order number?
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-length106
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": "What's my order number?",
      "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:58:15 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 b93403e5b15ed21bc6e80b8108e9d988.cloudfront.net (CloudFront)
x-amz-cf-idpKfrxPzC-EhU4HlEndQ4wiRObuas5VcNlfi5zNPBSMFAwZreFLyJBA==
x-amz-cf-popDEN52-P3
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id458c32bbe655193479e8eab074ca213a
{
  "id": "02364d63-290f-489a-b14c-f23f7b4e4f32",
  "object": "chat.completion",
  "created": 1789336695,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "I don\u2019t have access to your order details, so I can\u2019t look up your order number.\n\nYou can usually find it in:\n- Your order confirmation email\n- Your account\u2019s order history\n- The packing slip or receipt\n- Your bank/card transaction description (sometimes includes an order ID)\n\nIf you share the store/platform name and what you\u2019ve tried, I can help you figure out where to look.",
        "reasoning_content": "We need answer. User asks \"What's my order number?\" We don't have context. Need ask for info or explain cannot access. Need likely say I don't have access to your order details. Please provide info or check confirmation email/account. Must be concise. Since no context. We should not hallucinate. Need maybe if they want help finding it, tell where to look. We don't know platform. We can ask for email confirmation, account, etc. Also privacy. Final answer."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 36,
    "completion_tokens": 191,
    "total_tokens": 227,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 102
    },
    "prompt_cache_hit_tokens": 0,
    "prompt_cache_miss_tokens": 36
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiI don’t have access to your order details, so I can’t look up your order number. You can usually find it in: - Your order confirmation email - Your account’s order history - The packing slip or receipt - Your bank/card transaction description (sometimes includes an order ID) If you share the store/platform name and what you’ve tried, I can help you figure out where to look.
thread_b_starts_empty {"thread_b_message_count_before_reply": 1, "thread_b_never_saw_a100": true}
scenario the_checkpoint_granularity_is_finer_than_our_snapshot
scenario the_checkpoint_granularity_is_finer_than_our_snapshot · 4.0ms
turn 1 · 0.7ms · asked for: check_order
model mock · 0.7ms · asked for: check_order
context sent — 2 message(s)
rolecontent
[0]systemAnswer briefly.
[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"})
turn 1 · 0.0ms
checkpoint saved mid-turn, right after the crash · thread_id=crash-demo · 0.1ms
held_by_the_checkpointer {"message_count": 3, "roles": ["system", "human", "ai"]}
turn 1 · 0.2ms
tool check_order · 0.2ms · given: order_id=A100 · returned: order A100: shipped
args {"order_id": "A100"}
result {"value": "order A100: shipped"}
checkpoint saved after the resumed turn completed · thread_id=crash-demo · 0.1ms
held_by_the_checkpointer {"message_count": 4, "roles": ["system", "human", "ai", "tool"]}
resumed_without_reasking_the_model {"crashed": true, "checkpoint_captured_the_model_reply_before_the_crash": true, "call_model_invocations": 1, "call_tool_invocations": 2, "final_answer_present": true}
scenario the_checkpoint_granularity_is_finer_than_our_snapshot · 1039.0ms
turn 1 · 1032.3ms · 304 in / 62 out · asked for: check_order
model live · 1032.2ms (model provider 1022.3 · library 9.9) · 304 in / 62 out · asked for: check_order
context sent — 2 message(s)
rolecontent
[0]systemAnswer briefly.
[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-length376
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": "Answer briefly.",
      "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:58:17 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 bd570b43eaed44365882fda303fb189c.cloudfront.net (CloudFront)
x-amz-cf-idoUFefhsveU5eQuED2uoyPhiSyNl2cSLCFI9woYfMJ3tYiir0AHsmAg==
x-amz-cf-popDEN53-P1
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-idf691571c1bbac8f601c6a2190bfe98b2
{
  "id": "da0404c6-6212-4cc4-b886-fe941f43108b",
  "object": "chat.completion",
  "created": 1789336697,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "reasoning_content": "The user asks about order A100. I have a tool available: check_order. I should call it.",
        "tool_calls": [
          {
            "index": 0,
            "id": "call_00_lmtsWwibxwaaM0fQlc6H3214",
            "type": "function",
            "function": {
              "name": "check_order",
              "arguments": "{\"order_id\": \"A100\"}"
            }
          }
        ]
      },
      "logprobs": null,
      "finish_reason": "tool_calls"
    }
  ],
  "usage": {
    "prompt_tokens": 304,
    "completion_tokens": 62,
    "total_tokens": 366,
    "prompt_tokens_details": {
      "cached_tokens": 128
    },
    "completion_tokens_details": {
      "reasoning_tokens": 22
    },
    "prompt_cache_hit_tokens": 128,
    "prompt_cache_miss_tokens": 176
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]ai
check_order({"order_id": "A100"})
turn 1 · 0.0ms
checkpoint saved mid-turn, right after the crash · thread_id=crash-demo · 0.3ms
held_by_the_checkpointer {"message_count": 3, "roles": ["system", "human", "ai"]}
turn 1 · 0.6ms
tool check_order · 0.6ms · given: order_id=A100 · returned: order A100: shipped
args {"order_id": "A100"}
result {"value": "order A100: shipped"}
checkpoint saved after the resumed turn completed · thread_id=crash-demo · 0.1ms
held_by_the_checkpointer {"message_count": 4, "roles": ["system", "human", "ai", "tool"]}
resumed_without_reasking_the_model {"crashed": true, "checkpoint_captured_the_model_reply_before_the_crash": true, "call_model_invocations": 1, "call_tool_invocations": 2, "final_answer_present": true}
scenario a_checkpoint_is_not_memory
scenario a_checkpoint_is_not_memory · 1.4ms
turn 1 · 0.2ms · responded with: I don't know that.
model mock · 0.2ms · responded with: I don't know that.
context sent — 2 message(s)
rolecontent
[0]systemAnswer briefly.
[1]humanMy favorite color is teal.
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]aiI don't know that.
checkpoint saved -- scoped to color-thread only · thread_id=color-thread · 0.1ms
held_by_the_checkpointer {"message_count": 3, "roles": ["system", "human", "ai"]}
checkpoint a fresh thread -- nothing to load · thread_id=unrelated-thread · 0.0ms
held_by_the_checkpointer {"message_count": 0, "roles": []}
checkpoint_scope_vs_memory_scope {"fresh_thread_has_any_checkpointed_state": false, "cross_run_memory_still_finds_the_fact": true}
scenario a_checkpoint_is_not_memory · 1306.7ms
turn 1 · 1303.5ms · 40 in / 64 out · responded with: Nice! Teal is a beautiful color.
model live · 1303.5ms (model provider 1293.5 · library 10.0) · 40 in / 64 out · responded with: Nice! Teal is a beautiful color.
context sent — 2 message(s)
rolecontent
[0]systemAnswer briefly.
[1]humanMy favorite color is teal.
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-length155
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": "Answer briefly.",
      "role": "system"
    },
    {
      "content": "My favorite color is teal.",
      "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:58:18 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 3d0e42610dcaae09fca89f218dd914de.cloudfront.net (CloudFront)
x-amz-cf-idKfDgRtzt63hXEJlKrMHeD7lDUV8OAhjLBtIXbANcyKhjoD4dRpm_FA==
x-amz-cf-popDEN53-P4
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id24745c517b8da823bd1ebad06ae21d54
{
  "id": "1d71452c-5904-40ed-8a09-e5cc88ee089e",
  "object": "chat.completion",
  "created": 1789336698,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Nice! Teal is a beautiful color.",
        "reasoning_content": "We need answer briefly. User says \"My favorite color is teal.\" We need respond. No explicit question. Likely acknowledge. Maybe \"Nice! Teal is a beautiful color.\" Keep brief. Must not mention? We can just reply. Ensure no unnecessary."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 40,
    "completion_tokens": 64,
    "total_tokens": 104,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 54
    },
    "prompt_cache_hit_tokens": 0,
    "prompt_cache_miss_tokens": 40
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiNice! Teal is a beautiful color.
checkpoint saved -- scoped to color-thread only · thread_id=color-thread · 0.3ms
held_by_the_checkpointer {"message_count": 3, "roles": ["system", "human", "ai"]}
checkpoint a fresh thread -- nothing to load · thread_id=unrelated-thread · 0.0ms
held_by_the_checkpointer {"message_count": 0, "roles": []}
checkpoint_scope_vs_memory_scope {"fresh_thread_has_any_checkpointed_state": false, "cross_run_memory_still_finds_the_fact": true}
scenario we_can_bolt_our_own_disk_persistence_onto_it
scenario we_can_bolt_our_own_disk_persistence_onto_it · 3.9ms
turn 1 · 0.2ms · responded with: noted, on disk now.
model mock · 0.1ms · responded with: noted, on disk now.
context sent — 2 message(s)
rolecontent
[0]systemAnswer briefly.
[1]humanRemember: A100.
context ignored by the mock model {"messages": 2, "roles": ["system", "human"]}
reply
rolecontent
[0]ainoted, on disk now.
snapshot_written open file {"path": "out/ch34_checkpoint/we_can_bolt_our_own_disk_persistence_onto_it/disk-demo.json"}
turn 1 · 0.4ms · responded with: noted, on disk now.
model mock · 0.4ms · responded with: noted, on disk now.
context sent — 4 message(s)
rolecontent
[0]systemAnswer briefly.
[1]humanRemember: A100.
[2]ainoted, on disk now.
[3]humanWhat did I ask you?
context ignored by the mock model {"messages": 4, "roles": ["system", "human", "ai", "human"]}
reply
rolecontent
[0]ainoted, on disk now.
resumed_after_a_simulated_process_restart {"fresh_process_had_no_state_before_seeding": true, "seeding_from_disk_restored_state": true, "final_history_length": 5}
scenario we_can_bolt_our_own_disk_persistence_onto_it · 2408.1ms
turn 1 · 977.7ms · 38 in / 74 out · responded with: Got it — A100.
model live · 977.7ms (model provider 969.6 · library 8.0) · 38 in / 74 out · responded with: Got it — A100.
context sent — 2 message(s)
rolecontent
[0]systemAnswer briefly.
[1]humanRemember: 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-length144
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": "Answer briefly.",
      "role": "system"
    },
    {
      "content": "Remember: A100.",
      "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:58:19 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 153d2cbd7c83442a049eab26571069f6.cloudfront.net (CloudFront)
x-amz-cf-id1HhdkSfPxTF1UCYJX_M6PO4rOE8XCEQRD7z46VCKjEDrti4_7Lh37g==
x-amz-cf-popDEN53-P6
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-idc10b70bfd53cb200ecfda5efd2b87afb
{
  "id": "75f90d59-c556-4003-86f8-1a768d538df0",
  "object": "chat.completion",
  "created": 1789336699,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Got it \u2014 A100.",
        "reasoning_content": "We need answer briefly. Need infer? User says \"Remember: A100.\" Maybe they want acknowledge. We need respond briefly. Could be instruction to remember A100. We should say remembered. But maybe there's hidden context? We only have this. Need answer briefly. \"Got it \u2014 A100.\" Ensure no overdo."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 38,
    "completion_tokens": 74,
    "total_tokens": 112,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 67
    },
    "prompt_cache_hit_tokens": 0,
    "prompt_cache_miss_tokens": 38
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiGot it — A100.
snapshot_written open file {"path": "out/ch34_checkpoint/we_can_bolt_our_own_disk_persistence_onto_it/disk-demo.json"}
turn 1 · 1419.0ms · 54 in / 112 out · responded with: You asked me to remember: **A100**.
model live · 1418.9ms (model provider 1407.2 · library 11.7) · 54 in / 112 out · responded with: You asked me to remember: **A100**.
context sent — 4 message(s)
rolecontent
[0]systemAnswer briefly.
[1]humanRemember: A100.
[2]aiGot it — A100.
[3]humanWhat did I ask you?
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-length242
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": "Answer briefly.",
      "role": "system"
    },
    {
      "content": "Remember: A100.",
      "role": "user"
    },
    {
      "content": "Got it \u2014 A100.",
      "role": "assistant"
    },
    {
      "content": "What did I ask you?",
      "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:58:20 GMT
serverelb
strict-transport-securitymax-age=31536000; includeSubDomains; preload
transfer-encodingchunked
varyorigin, access-control-request-method, access-control-request-headers
via1.1 fca1997d98cd4ed3a56af08cac126fa6.cloudfront.net (CloudFront)
x-amz-cf-idbbx8B4HFMeS58nn3D0UvLSXTplMIrZCUE4VUPYyZMTYFpqGCazXHhw==
x-amz-cf-popDEN53-P3
x-cacheMiss from cloudfront
x-content-type-optionsnosniff
x-ds-trace-id2e75a3fc473018ff88a0b1a94a7b0113
{
  "id": "4a437fdf-cc8d-4f7a-8a9e-9fc1877dd667",
  "object": "chat.completion",
  "created": 1789336700,
  "model": "deepseek-flash",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "You asked me to remember: **A100**.",
        "reasoning_content": "We need answer. User asks \"What did I ask you?\" Previous: user: \"Remember: A100.\" assistant: \"Got it \u2014 A100.\" Then user: \"What did I ask you?\" We need answer briefly. They asked me to remember A100. Also current question? \"What did I ask you?\" We can say: You asked me to remember \"A100.\" Then you asked what you had asked me. Need maybe no extra. Ensure not confuse. We should answer."
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 54,
    "completion_tokens": 112,
    "total_tokens": 166,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 101
    },
    "prompt_cache_hit_tokens": 0,
    "prompt_cache_miss_tokens": 54
  },
  "system_fingerprint": "aeb56401ca74e127821c4f9126dcb669"
}
reply
rolecontent
[0]aiYou asked me to remember: **A100**.
resumed_after_a_simulated_process_restart {"fresh_process_had_no_state_before_seeding": true, "seeding_from_disk_restored_state": true, "final_history_length": 5}