resultType on every result, for the clients that require it (#107) - #122
Merged
Conversation
) SEP-2322 makes resultType required on every result: "complete" for an ordinary one, "input_required" for an MRTR interim result. We return no interim results - the server initiates no sampling, elicitation or roots requests - so this is the "complete" half only. Set only when the request declares 2026-07-28 or later. A client on an older revision is told to read an absent field as "complete" anyway, and may validate strictly against a schema with no field for it, so adding it there would be risk without meaning. Which revision that is arrives per request now, which is why this waited on #106. Never overwrites a value already there: a CreateTaskResult is "task", and saying "complete" over the top would tell the client the work had finished when it has not started. Revisions are dated names, so the gate is an ordinal comparison and a future revision inherits the newer behaviour. The one awkward case is a tool result nested inside a later tasks/get: the poll carries its own context, not the caller's, so the revision the CREATING request asked in decides the nested shape. 5 tests.
12 tasks
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.
Closes #107. Second of the conformance block; builds directly on #106.
SEP-2322 makes
resultTyperequired on every result —"complete"for an ordinary one,"input_required"for a Multi Round-Trip interim result. We return no interim results (the server initiates no sampling, elicitation or roots requests), so this is the"complete"half only; MRTR stays out of scope as the issue says.Change
resultType: "complete"on every result when the request declares 2026-07-28 or later. That gate is per request, which is exactly why this waited on the request-context work."complete", and may validate strictly against a schema with no field for it — adding it there is risk without meaning.RequestContext.DeclaresRevisionAtLeast), so a future revision inherits the newer behaviour rather than falling back to the older one.Two things worth a look
It never overwrites a value already present. A
CreateTaskResultis"task"; stamping"complete"over it would tell the client the work had finished when it has not started. One line, but it is the bug this PR would otherwise have shipped.A tool result nested inside a later
tasks/getis the awkward case: the poll carries its own_meta, not the caller's, and the result was produced before the poll existed. The revision the creating request declared decides the nested shape, so a client that asked in 2026-07-28 getsresultTypeon both the poll and the result inside it.Verification
ping/tools/list/tools/callon the new revision; absent with no_metaand absent on 2025-06-18; applied to a later-dated revision; and the task case end to end (handle stays"task", poll is"complete", nested tool result is"complete").README: the "Protocol revisions" section now covers it.