Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9cf8166
Agents: a LangGraph run whose last step's writes are stored but not i…
igalshilman Nov 24, 2026
f5871dc
Shared core 8.7.3: SQL calls run where they are polled, sessions shar…
igalshilman Nov 24, 2026
0ab779a
Agents: the calls of an invocation's prompts are kept apart
igalshilman Nov 24, 2026
14c4ad5
Agents: tests of what a turn's Restate tools cost in commits
igalshilman Nov 24, 2026
c803589
Agents: LangGraph's model sees an empty answer, and a blank reply of …
igalshilman Nov 24, 2026
3cc8c24
Merge claude/commit-counts-restate-tools
igalshilman Nov 24, 2026
5dd5845
Merge claude/calls-per-prompt
igalshilman Nov 24, 2026
1e034b6
Sessions: one heartbeat timer across back-to-back working scopes; RES…
igalshilman Nov 24, 2026
9e17a5a
Sessions: RESTATE_SQL_L0_BYTES sets how much of a database's checkpoi…
igalshilman Nov 24, 2026
8753f18
Agents: the records of a Restate call ride the commit that stores its…
igalshilman Nov 24, 2026
eab138c
Sessions: an urgent rider stops counting once its attempt ended; the …
igalshilman Nov 24, 2026
22b8d50
Merge commit counts
igalshilman Nov 24, 2026
d618d3a
Agents: the record of a new call is carried by a transaction that is …
igalshilman Nov 24, 2026
9509407
Agents: LangGraph's checkpointer stores a task's writes with the chec…
igalshilman Nov 24, 2026
9375d96
Merge claude/shared-core-8.7.3
igalshilman Nov 24, 2026
a7b700e
Merge claude/sql-l0-bytes
igalshilman Nov 24, 2026
c673108
Merge claude/heartbeat-timer
igalshilman Nov 24, 2026
ae58fa9
Merge claude/langgraph-resume-stored-writes
igalshilman Nov 24, 2026
6629aae
Merge claude/blank-reply
igalshilman Nov 24, 2026
e7db8d8
Merge claude/calls-per-prompt
igalshilman Nov 24, 2026
250db0a
Merge claude/commit-counts-restate-tools
igalshilman Nov 24, 2026
b576a5b
Merge claude/calls-ride-commit
igalshilman Nov 24, 2026
c56a19e
Merge claude/langgraph-writes-with-checkpoint
igalshilman Nov 24, 2026
e9f2f47
Sessions: a run of working scopes beats once the silence reaches the …
igalshilman Nov 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] }
# directory); `tunnel` is Restate Cloud's. `aws_lc_rs` is the crypto of all of them (the
# tunnel's TLS, request identity's signatures), as the object stores' must be aws-lc.
# 8.7.1: a cancellation resumes an invocation shut down while it waits for a call (sdk-shared-core#120).
restate-sdk-shared-core = { version = "8.7.1", features = [
# 8.7.3: SQL calls run where they are polled; compiled statements are shared between the sessions of one
# schema (sdk-shared-core#121, #123).
restate-sdk-shared-core = { version = "8.7.3", features = [
"request_identity",
"sha2_random_seed",
"aws_lc_rs",
Expand Down
19 changes: 17 additions & 2 deletions docs/agents/conversation.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ CREATE TABLE restate_agent_steers ( -- the messages steered to a turn t
| --- | --- | --- |
| `restate_agent_calls` (schema `restate-agents.calls`), in the key's database | one row: the invocation's Restate calls made by tools, as JSON ([Tool calls, once](#tool-calls-once-the-call-records)) | the tools built on Restate (`call`, `send`, `workflow`, `subagent`, `wait_for_signal`) and `wait_for` |
| the companion's state: the agent's own object `<agent>.prebuilt.restate`, keyed as the agent | `turn`: the turn being answered (`Started`: its invocation, since when, whether it takes steered messages and whether `start` publishes it); `waiting`: the tools' waits, each with its awakeable; `kept`: signals that came before their wait; `revision`; `watching`: the `watch` calls waiting for a newer revision | the companion's handlers (`start`, `close`, `wait`, `signal`, `publish`, `watch`) |
| `restate_langgraph_checkpoints`, `restate_langgraph_channel_values`, `restate_langgraph_writes` (schema `restate_agents.langgraph`) | a LangGraph graph's checkpoints, channel values by version, and pending writes, per thread and namespace | `SqlCheckpointSaver`, for `langgraph.agent(graph=...)`; pruned to what the latest checkpoint of each namespace needs after each run |
| `restate_langgraph_checkpoints`, `restate_langgraph_channel_values`, `restate_langgraph_writes` (schema `restate_agents.langgraph`) | a LangGraph graph's checkpoints, channel values by version, and pending writes, per thread and namespace | `SqlCheckpointSaver`, for `langgraph.agent(graph=...)`; a step's writes are in the commit of the checkpoint that follows them, when it follows at once; pruned to what the latest checkpoint of each namespace needs after each run |
| `restate_pydantic_ai_plan`, `restate_pydantic_ai_spills`, `restate_pydantic_ai_journal` (schema `restate_agents.pydantic_ai`) | the harness's plan (`plan_store()`), spilled tool results (`overflow_store()`), and each tool call's journal of plan reads and writes, for the current invocation | the Pydantic AI stores |
| `restate_pydantic_ai_memory`, `..._receipts`, `..._generation` (schema `restate_agents.pydantic_ai.memory`), in a memory object's key | the harness's memory files, the receipts of the changes, and the version counter: one key per namespace (a user), shared by that user's conversations | `memory()`'s session object |

Expand Down Expand Up @@ -525,6 +525,7 @@ invocation (the next invocation's first call replaces it):
| `attempt` | the attempt that last made it |
| `done`, `failed` | whether the Restate call returned, and the terminal error it returned, if any |
| `approval` | the call is an approval that its tool call waited for (`wait_for(..., approval=True)`) |
| `prompt` | the prompt whose turn made the call; absent for a call made outside a prompt, and in a row an earlier version stored |

- **Matching a call.** A tool call finds the record it made before by its id
and its tool: one tool call may make two calls (an approval, then the
Expand All @@ -533,11 +534,24 @@ invocation (the next invocation's first call replaces it):
input: a framework that tells the model its call was cut off gets the call
again under a new id, and that is the same Restate call, with the same
idempotency key, which it waits for again or whose result it gets.
- **Per prompt.** An invocation can prompt more than once (`<id>`, `<id>:2`, ...). `answer_once` keeps the
calls its run makes as its prompt's, and a call is matched, and rejoined, among its prompt's records only: a
second prompt that makes the call the first made (the same tool and input) takes a call of its own, not the
first's, which a crash left stored.
- **A framework's own wait is its tool call's alone** (`wait_for`). The
framework stored the tool call before it waits, so a retried attempt waits
again under the same id; a new call with the same input (the model asking
again after the first's answer) waits anew, and never gets an earlier
call's approval or denial.
- **When it is written.** Only the record of a new call commits of its own, before the call is made. That a call
returned (`done`) rides a commit that is under way or starts at once: the one that stores the call's result,
so that the transcript never has a result of a call that is not recorded as returned. If none does (a slow
tool of the round still runs, another call waits), it is written in a transaction of its own once no commit has
started for `URGENT_HOPS` event-loop iterations, so it is never left unrecorded for long. That a record is
forgotten rides the next commit, whenever it comes, and a turn's end writes what is still pending. A crash in
the few moments before the return is written reads the call as one that did not return: it is made again under
the same key, and a stopped turn that another invocation closes reports it as cut off. This is
`restate.sessions.internal.ride_commit`.
- **Forgetting.** After each write of steps that commits (once, before the
publish an agent's turn makes there, and in a plain session object's turn
too, which publishes nothing) and before each tool call, a record whose
Expand All @@ -550,7 +564,8 @@ invocation (the next invocation's first call replaces it):
- **Closing a turn.** A turn that closes with open calls gives each a result:
the error its Restate call returned, or `RETURNED_UNRECORDED` ("Done, but
the turn was stopped before this call's result was recorded: it did
happen…") if it returned, or else the note that closes the turn. The
happen…") if it returned (a call of its own prompt: another prompt's call of the invocation is not its),
or else the note that closes the turn. The
results, the note and the answer are one transaction: a crash between them
would leave the turn open, and closing it again would add a second note. An
approval returning is not the call: a denied call is closed with the note.
Expand Down
11 changes: 11 additions & 0 deletions docs/agents/frameworks.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,17 @@ sequenceDiagram
pointing to) the whole state, the message list included. There is no turn:
a thread is a chain of checkpoints. Messages have ids, and
`RemoveMessage(id)` (or `REMOVE_ALL_MESSAGES`) removes them.
- **A task's writes are saved apart from its step's checkpoint:** the saver
is called with `put_writes` as each task finishes, and with `put` once the
step's last task has (before the next step starts, with
`durability="sync"`). A parallel step's finished tasks are therefore
saved while their siblings still run, so that they do not run again after
a crash. LangGraph waits for every `put_writes` before a run ends, and
before the step's `put` only for a `DeltaChannel`'s writes, an error
handler's and `update_state`'s. The checkpointer keeps a task's writes
pending, and the `put` that follows at once stores them in its own
transaction, before its checkpoint; else they are stored alone after a few
event-loop iterations.
- **`DeltaChannel`** (a beta) stores a channel's writes, and its whole value
only now and then (a snapshot); its value is rebuilt from the latest
snapshot and the writes after it.
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/porting.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ tests. Test names are this SDK's.
| Call records: made once, rejoined under a new id, kept until stored, forgotten after | `tests/agents_tools.py` (`test_a_returned_call_is_kept_until_its_result_is_stored_and_forgotten_once_it_is`) |
| The companion: start, close, `awaitTurn`, `settle`, waits and signals; one per agent, keyed as it, ingress-private | `tests/agents_signals.py`, `tests/agents_companion.py`, `tests/agents_object.py` |
| Per framework: answer and the full view after it, a crash in a tool, a stored answer not asked again, refused, stopped, `output=`, several prompts | each framework's `tests/agents_<framework>*.py` |
| The LangGraph checkpointer: resume, history, prune, `DeltaChannel`, many channels | `tests/agents_langgraph_checkpointer.py` |
| The LangGraph checkpointer: resume, history, prune, `DeltaChannel`, many channels | `tests/agents_langgraph_checkpointer.py`, `tests/agents_langgraph_writes.py` (a task's writes with the checkpoint that follows, or alone; a parallel step cut while a node runs), `tests/agents_commits.py` (the commit sequence) |

And the mutants of `scripts/resurrect.py` ([Testing](testing.md)): each
brings back one bug that a fix describes, or breaks one rule of the turn. A
Expand Down
8 changes: 6 additions & 2 deletions docs/agents/turns.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,8 @@ sequenceDiagram
after the timeout, so that a wait of days holds no process, and the next
attempt gets the cancellation as it starts. A deployment that sets an
inactivity timeout under 20 seconds is shut down between two of those
messages.
messages, unless it shortens the interval with `RESTATE_SESSIONS_HEARTBEAT`
(in milliseconds).
- A cancellation that comes once the turn answered changes nothing: the
answer stands.
- A tool cut short by the stop raises the stop's reason, so the model never
Expand Down Expand Up @@ -691,7 +692,10 @@ tool calls, and no call or result after it), the note that closed it, or
else its answer, stored as its reply, from the agent the turn is with (a
turn that ended with a tool's output that is the answer, say). That message
is the answer's in the summary, under the same id. Only an empty answer gets
no message. A LangGraph graph, which keeps its own messages, is given only a
no message. A LangGraph agent's model sees an empty answer, and a reply of
its own with nothing in it (stored as it came), as `(no answer)` in the
conversation that goes on: a model provider may refuse an empty message. A
LangGraph graph, which keeps its own messages, is given only a
closed turn's closing record, never an answer the conversation stored.

**Asking again within a turn.** A turn can ask the model again before it
Expand Down
Loading
Loading