Repository navigation
Pre-release review fixes: utcp core - #22
Merged
Merged
Conversation
- Deeply nested tool schemas parse again: JsonSchema.fromJson no longer recurses, so a 50,000-deep `inputs` cannot overflow the stack and crash UtcpClient.create. - A millisecond field that overflows to infinity (`"timeout": 1e306`) throws a FormatException naming the field instead of UnsupportedError. - `http` sends a GET with its body, as the Python and TypeScript SDKs do; `streamable_http` still rejects it, as TypeScript does. A null body argument means no body everywhere. buildToolRequest takes a GetWithBody instead of postWithBody. - Null `const` and `default` are dropped like every other null keyword. - Tests pin the OAuth2 same-origin 401 guard, the stale-token eviction check and the string `expires_in` cache lifetime. - CHANGELOG marks the HTTP result and VariableLoader.toJson changes as breaking.
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 the pre-release audit findings in
utcp: deep tool schemas and huge timeouts no longer crash parsing, and a GET body now behaves as in the reference SDKs. Follow-up to #4.Fixes
JsonSchema.fromJsonwalked nested schemas recursively, so a tool whoseinputsnested about 10,000 deep raisedStackOverflowError. That error got past discovery'son Exceptioncatches and crashedUtcpClient.create. The walk is now iterative; a 50,000-deep schema parses again, as it did in 0.2.1.optMillisecondscheckedisFinitebefore multiplying by 1000, so"timeout": 1e306(streamable_http) orretry_timeout(sse) threwUnsupportedError, and a finite value too large for aDuration(such as 1e16 ms) wrapped to a negative one on the VM. Both now throw aFormatExceptionnaming the field.httpsends the GET with its body, as Python (aiohttp) and TypeScript (axios) do; Elasticsearch_searchrelies on this.streamable_httpstill throws, as TypeScript does. A body argument that is null or absent means no body on every transport, so{'body': null}on a GET never throws.buildToolRequesttakes aGetWithBody(send,reject,sendAsPost) in place of the unreleasedpostWithBody. A body is still never resent to another origin on a redirect.constanddefaultare dropped like every other null keyword, because Python writes them as null on every schema node. No conformance fixture changes, since the corpus already treats an explicit null as absent. The interop drivers need no new exclusion.uri.origin == request.uri.origin);_tokens[key]?.value == token);expires_in: " 1 "sets a one-second cache lifetime, not the 3600 s default (string branch of_expiresIn).String;HttpResult.decodeno longer parses YAML) andVariableLoader.toJsonare marked Breaking. The GET-body bullet and the null-keyword bullet are corrected.GET body decision
flowchart TD A[Tool call on a GET template] --> B{body_field argument<br/>null or absent?} B -- yes --> N[Send GET, no body] B -- no --> C{Transport} C -- http --> S[Send GET with body<br/>Python and TypeScript do] C -- streamable_http --> R[Throw UtcpException<br/>before any request, as TypeScript does] C -- sse --> P[Send POST with body]Verification
dart format --output=none --set-exit-if-changed .,dart analyze --fatal-infos: cleandart test(root,packages/utcp,packages/utcp_conformance) anddart test -p chrome test/unit: passtool/interop/run.shwith Python 3.12: exit 0