Repository navigation
Handle durable run states instead of returning empty results - #2
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With durable execution on, the server can answer
queued,stuck,cancelled,aborted,expiredorindeterminate, andGET /v1/runs/{id}nests a finished result underresponse. The SDK read all of these as a finished run with no result.Now
queuedkeeps polling, a finished durable run returns its real result, and every other state raisesRunStateErrorwith the run ID, status and reason. A plain-text 404 raisesUnknownRunError. langchain-submilli gives these to the agent as error results. Non-durable behavior is unchanged.Before release: raise langchain-submilli's minimum
submilliversion, because it now importsRunStateError.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