Skip to content

Handle durable run states instead of returning empty results - #2

Merged
somdoron merged 2 commits into
mainfrom
claude/durable-run-states
Oct 25, 2026
Merged

somdoron merged 2 commits into
mainfrom
claude/durable-run-states

Conversation

@ehudfisher

@ehudfisher ehudfisher commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

With durable execution on, the server can answer queued, stuck, cancelled, aborted, expired or indeterminate, and GET /v1/runs/{id} nests a finished result under response. The SDK read all of these as a finished run with no result.

Now queued keeps polling, a finished durable run returns its real result, and every other state raises RunStateError with the run ID, status and reason. A plain-text 404 raises UnknownRunError. langchain-submilli gives these to the agent as error results. Non-durable behavior is unchanged.

Before release: raise langchain-submilli's minimum submilli version, because it now imports RunStateError.
Checks: CI passes: lint, types, unit tests on Python 3.11 to 3.14, and integration tests against server 0.4.1.

https://claude.ai/code/session_01NpLwG8FwhVDiba6UTPUssM


Generated by Claude Code

claude and others added 2 commits October 25, 2026 08:59
A server with durable_execution reports runs as queued, stuck, cancelled,
aborted, indeterminate, expired, or completed (GET /v1/runs/{id}, with the
result nested in `response`). run_state() read every status it did not know
as a finished run, so these came back as an ExecuteResult with no result.

- queued is a RunningRun (status "queued") that runs.complete polls.
- completed with a finished `response` returns that ExecuteResult.
- Any other status raises the new RunStateError, which carries the run's
  execution_id, session_id, status, reason, and body.
- GET /v1/runs/{id}'s plain-text 404 "unknown run" raises UnknownRunError.
- langchain-submilli reports a RunStateError to the model as an error
  result with the status and reason, as it does a lost run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NpLwG8FwhVDiba6UTPUssM
@somdoron
somdoron merged commit 62fdf8c into main Oct 25, 2026
14 checks passed
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.

3 participants