Repository navigation
Conversation
…d durable iter() Fixes restatedev#237
|
All contributors have signed the CLA ✍️ ✅ |
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.
Fixes #237.
Changes
_toolset.py: PreserveToolReturn(return_value,content,metadata) via a typedtool_return: ToolReturn | None = Nonefield onRestateContextRunResult, and preserveCallDeferred.metadata/ApprovalRequired.metadataviametadata: dict[str, Any] | None = None. Default both fields toNoneso existing journal entries continue to deserialize._toolset.py&turnstile.py: Callturnstile.allow_next_after(id)and do not cancel sibling tool calls when a tool raisesCallDeferred,ApprovalRequired, orModelRetry. Ignore untrackedtool_call_idvalues inTurnstile.wait_forandcancel_all_after(such as resumed deferred tool calls before the first model request or nested tool calls) unless the turnstile is already canceled._model.py: Initializecurrent_state().turnstileinRestateModelWrapper.request_streamjust as inrequest(also addresses pydantic ext: request_stream() never initializes the turnstile — KeyError('call_...') on first tool call of a streamed run #223)._agent.py: OverrideRestateAgent.iter()withwith self._restate_overrides():and matching output-type overloads soagent.iter()uses the durable model and toolset wrappers.tests/test_pydantic_ext.py: Add 13 unit tests coveringToolReturnround-trip,CallDeferredmetadata, parallelApprovalRequired/CallDeferred/ModelRetrysibling execution,request_streamturnstile initialization, resumed deferred tool calls, untracked turnstile IDs, and durableagent.iter().