# Interrupt and resume, real model. pin {'langgraph': '1.2.22 (tag 08a20169)', 'langchain': '1.5.0', 'langchain-core': '1.8.0', 'langgraph-checkpoint': '4.3.2', 'langgraph-checkpoint-sqlite': '3.1.3'}. {'name': 'the x86 server guest', 'cpu': 'AMD EPYC 7452 (KVM guest, 32 vCPU, 48 GiB, no GPU)', 'platform': 'Linux-6.8.0-147-generic-x86_64-with-glibc2.39', 'python': '3.13.18', 'loadavg_1_5_15': ['9.32', '3.99', '6.14'], 'ollama_ps': [{'name': 'qwen3:4b-instruct-2507-q4_K_M', 'size_vram': 0, 'context_length': 8192}, {'name': 'qwen3:8b', 'size_vram': 0, 'context_length': 8192}]}
# model {'provider': 'ollama 0.31.1 (CPU)', 'model': 'qwen3:4b-instruct-2507-q4_K_M', 'temperature': 0, 'seed': 42, 'think/reasoning': False, 'num_ctx': 8192}
graph: START -> {ask, approve, other} -> after. ask calls the model, interrupt(), the model, interrupt(); approve calls the model, then interrupt(); other calls get_weather and the model, never interrupts; after calls the model. Each model call is logged.

## run 1: invoke(input)
  returned interrupt id=462dc352bc169ed50a32e43c579712fb value={'q': 'Which city would you like to visit?'}
  returned interrupt id=11314d20c136a4a3ec3a8a26c24243c9 value={'q': 'Could you please approve a travel budget of 900 EUR for the upcoming business trip to Berlin?'}
  node log during run 1:
    {"node": "approve", "event": "enter (first line)", "ns": "approve:56f9f439-6fe7-44ef-ec89-762fd2b36cf4", "scratchpad.resume": [], "null_resume": null}
    {"node": "ask", "event": "enter (first line)", "ns": "ask:db8df5fb-7f77-0ac1-61de-e4a38b97c8a0", "scratchpad.resume": [], "null_resume": null}
    {"node": "other", "event": "enter (side effect)"}
    {"node": "ask", "event": "model call -> 'Which city would you like to visit?'", "model_s": 1.39}
    {"node": "approve", "event": "model call -> 'Could you please approve a travel budget of 900 EUR for the upcoming b'", "model_s": 3.51}
    {"node": "other", "event": "model call -> 'Oslo weather: cold, rainy.'", "model_s": 4.21}
  saver.writes after run 1:
    ckpt=..88027e62558c task=9ef14c34 idx= 0 path='~__pregel_pull, __start__'      log            []
    ckpt=..88027e62558c task=9ef14c34 idx= 1 path='~__pregel_pull, __start__'      branch:to:ask  None
    ckpt=..88027e62558c task=9ef14c34 idx= 2 path='~__pregel_pull, __start__'      branch:to:approve None
    ckpt=..88027e62558c task=9ef14c34 idx= 3 path='~__pregel_pull, __start__'      branch:to:other None
    ckpt=..1ca1bd022200 task=56f9f439 idx=-3 path='~__pregel_pull, approve'        __interrupt__  ["Interrupt(id=11314d20c136, value={'q': 'Could you please approve a travel budget of 900 EUR for the upcoming business trip to Berlin?'})"]
    ckpt=..1ca1bd022200 task=db8df5fb idx=-3 path='~__pregel_pull, ask'            __interrupt__  ["Interrupt(id=462dc352bc16, value={'q': 'Which city would you like to visit?'})"]
    ckpt=..1ca1bd022200 task=2d4e3d81 idx= 0 path='~__pregel_pull, other'          log            ['other:Oslo weather: cold, rainy.']
    ckpt=..1ca1bd022200 task=2d4e3d81 idx= 1 path='~__pregel_pull, other'          branch:to:after None
  get_state.next=('ask', 'approve'); tasks=[('ask', 'db8df5fb', ['462dc352bc16']), ('approve', '56f9f439', ['11314d20c136']), ('other', '2d4e3d81', [])]
  recompute id for ask: xxh3_128(task_checkpoint_ns='ask:db8df5fb-7f77-0ac1-61de-e4a38b97c8a0') = 462dc352bc16... matches=True
  recompute id for approve: xxh3_128(task_checkpoint_ns='approve:56f9f439-6fe7-44ef-ec89-762fd2b36cf4') = 11314d20c136... matches=True

## run 2a: Command(resume='yes') without an id while 2 interrupts are pending
  raises RuntimeError: When there are multiple pending interrupts, you must specify the interrupt id when resuming. Docs: https://docs.langchain.com/oss/python/lan
  node log during run 2a:

## run 2b: Command(resume={ask_id: 'A1', approve_id: 'OK'})
  node log during run 2b:
    {"node": "approve", "event": "enter (first line)", "ns": "approve:56f9f439-6fe7-44ef-ec89-762fd2b36cf4", "scratchpad.resume": ["OK"], "null_resume": null}
    {"node": "ask", "event": "enter (first line)", "ns": "ask:db8df5fb-7f77-0ac1-61de-e4a38b97c8a0", "scratchpad.resume": ["A1"], "null_resume": null}
    {"node": "ask", "event": "model call -> 'Which city would you like to visit?'", "model_s": 1.16}
    {"node": "ask", "event": "interrupt #0 returned 'A1'"}
    {"node": "approve", "event": "model call -> 'Could you please approve a travel budget of 900 EUR for the upcoming b'", "model_s": 2.98}
    {"node": "approve", "event": "interrupt returned 'OK'"}
    {"node": "ask", "event": "model call -> 'How many nights will the traveller stay at A1?'", "model_s": 2.77}
  tick step=1 returns=True to_run=['approve', 'ask'] reapplied(no rerun)=['other']
  returned interrupt id=177b6fc6979f90e1a13103fec68d96fb value={'q': 'How many nights will the traveller stay at A1?'}
  second interrupt id expected = xxh3_128(ns + '|1') = 177b6fc6979f... matches=True
  saver.writes after run 2b:
    ckpt=..88027e62558c task=9ef14c34 idx= 0 path='~__pregel_pull, __start__'      log            []
    ckpt=..88027e62558c task=9ef14c34 idx= 1 path='~__pregel_pull, __start__'      branch:to:ask  None
    ckpt=..88027e62558c task=9ef14c34 idx= 2 path='~__pregel_pull, __start__'      branch:to:approve None
    ckpt=..88027e62558c task=9ef14c34 idx= 3 path='~__pregel_pull, __start__'      branch:to:other None
    ckpt=..1ca1bd022200 task=56f9f439 idx=-4 path='~__pregel_pull, approve'        __resume__     ['OK']
    ckpt=..1ca1bd022200 task=56f9f439 idx=-3 path='~__pregel_pull, approve'        __interrupt__  ["Interrupt(id=11314d20c136, value={'q': 'Could you please approve a travel budget of 900 EUR for the upcoming business trip to Berlin?'})"]
    ckpt=..1ca1bd022200 task=56f9f439 idx= 1 path='~__pregel_pull, approve'        log            ['approve:OK']
    ckpt=..1ca1bd022200 task=56f9f439 idx= 2 path='~__pregel_pull, approve'        branch:to:after None
    ckpt=..1ca1bd022200 task=db8df5fb idx=-4 path='~__pregel_pull, ask'            __resume__     ['A1']
    ckpt=..1ca1bd022200 task=db8df5fb idx=-3 path='~__pregel_pull, ask'            __interrupt__  ["Interrupt(id=177b6fc6979f, value={'q': 'How many nights will the traveller stay at A1?'})"]
    ckpt=..1ca1bd022200 task=2d4e3d81 idx= 0 path='~__pregel_pull, other'          log            ['other:Oslo weather: cold, rainy.']
    ckpt=..1ca1bd022200 task=2d4e3d81 idx= 1 path='~__pregel_pull, other'          branch:to:after None

## run 3: Command(resume='A2') (only one interrupt pending now, no id needed)
  node log during run 3:
    {"node": "ask", "event": "enter (first line)", "ns": "ask:db8df5fb-7f77-0ac1-61de-e4a38b97c8a0", "scratchpad.resume": ["A1"], "null_resume": "A2"}
    {"node": "ask", "event": "model call -> 'Which city would you like to visit?'", "model_s": 1.09}
    {"node": "ask", "event": "interrupt #0 returned 'A1'"}
    {"node": "ask", "event": "model call -> 'How many nights will the traveller stay at A1?'", "model_s": 1.27}
    {"node": "ask", "event": "interrupt #1 returned 'A2'"}
    {"node": "after", "event": "enter"}
    {"node": "after", "event": "model call -> 'booked'", "model_s": 0.65}
  final log: ['approve:OK', 'ask:A1/A2', 'other:Oslo weather: cold, rainy.', 'after:booked']

## model calls per invocation: {'run 1': 3, 'run 2a': 0, 'run 2b': 3, 'run 3': 3}
## checkpoint history (newest first)
  step=2 source=loop next=() id=..bc1c0b7b902f
  step=1 source=loop next=('after',) id=..9a14716dbcea
  step=0 source=loop next=('ask', 'approve', 'other') id=..1ca1bd022200
  step=-1 source=input next=('__start__',) id=..88027e62558c
