Skip to content

docs(state)!: inspect_state is a coroutine, so the graph must be awaited - #134

Merged
ciaransweet merged 1 commit into
mainfrom
docs/inspect-state-is-async
Sep 10, 2026
Merged

docs(state)!: inspect_state is a coroutine, so the graph must be awaited#134
ciaransweet merged 1 commit into
mainfrom
docs/inspect-state-is-async

Conversation

@ciaransweet

Copy link
Copy Markdown
Contributor

Reading a key as it stood at an earlier turn reaches the host's conversation
store, and there is no synchronous way in — so inspect_state is a coroutine,
and a host that drives its graph with invoke rather than ainvoke has to
switch.

Worth saying out loud in the consuming guide because of when it goes wrong:
building the graph succeeds, and the failure arrives the first time the model
calls the tool, which is in front of a user.

Why this is a release marker as well as a doc

#114 merged as a plain feat(state):, so the open release PR proposes 0.8.6.
Every consumer pins <0.9.0 — mcp-toolsets and all four dss packages — and
0.8.6 satisfies all of them, so it would land on the next lock refresh with
nobody choosing it. bump-minor-pre-major is set, so a breaking marker makes
it 0.9.0 instead: the pins then hold, and each consumer widens its bound
deliberately, which is the moment to check whether it invokes synchronously.

Nothing in this repo or in dss invokes synchronously, so nothing is broken
today. The pin is what protects a consumer we do not know about.

BREAKING CHANGE: inspect_state is async. A host invoking its graph
synchronously must switch to ainvoke or stream_turn. read_state_key also
appends its turn note after the JSON on a key more than one turn wrote, so that
output is no longer parseable as JSON.

🤖 Generated with Claude Code

Reading a key as it stood at an earlier turn reaches the host's conversation
store, and there is no synchronous way in — so the tool is async, and a host
that drives its graph with `invoke` rather than `ainvoke` has to switch.

Worth saying out loud in the consuming guide because of when it goes wrong:
building the graph succeeds, and the failure arrives the first time the model
calls the tool.

BREAKING CHANGE: `inspect_state` is async. A host invoking its graph
synchronously must switch to `ainvoke` or `stream_turn`. `read_state_key` also
appends its turn note after the JSON on a key more than one turn wrote, so that
output is no longer parseable as JSON.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ciaransweet
ciaransweet merged commit e1e7f93 into main Sep 10, 2026
4 checks passed
@ciaransweet
ciaransweet deleted the docs/inspect-state-is-async branch September 10, 2026 13:04
ciaransweet pushed a commit that referenced this pull request Sep 10, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.9.0](mcp-toolsets-runtime-v0.8.5...mcp-toolsets-runtime-v0.9.0)
(2026-09-10)


### ⚠ BREAKING CHANGES

* **state:** `inspect_state` is async. A host invoking its graph
synchronously must switch to `ainvoke` or `stream_turn`.
`read_state_key` also appends its turn note after the JSON on a key more
than one turn wrote, so that output is no longer parseable as JSON.

### Features

* **state:** read a state key as it stood at an earlier turn
([#114](#114))
([6fc5f2b](6fc5f2b))


### Documentation

* **state:** inspect_state is a coroutine, so the graph must be awaited
([#134](#134))
([e1e7f93](e1e7f93))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: ds-release-bot[bot] <116609932+ds-release-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant