Repository navigation
fix(output): preserve schema constants in approval resume hints - #151
Merged
yarolegovich merged 3 commits intoNov 18, 2026
Merged
Conversation
yarolegovich
left a comment
Member
There was a problem hiding this comment.
thanks for the fix! let's rebase and update the approval examples in docs/reference/output.md, docs/guide/conversations.md and lessons/04-conversations, they now print the --data-part hint
vathuluri
force-pushed
the
fix/structured-approval-resume
branch
from
November 18, 2026 00:49
866cb3a to
86490fd
Compare
Contributor
Author
|
Thanks @yarolegovich —addressed in 86490fd after rebasing onto main. Added the malformed-schema fallback and regression tests, restored the string return type, simplified property parsing, removed the redundant comment, and updated all three documentation examples. Kept because the documented status text lists allowed replies. All current CI checks pass, including Linux race tests, lint, all 11 demos, and Pages. AI-assisted revision. |
structuredResumeData only feeds a best-effort hint, so it returns the template or an empty string. The 04-conversations scenario answers with the --data-part hint the lesson now shows.
yarolegovich
approved these changes
Nov 18, 2026
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.
Problem and change
Fixes #149. When an input-required Task carries a Structured Input object schema, the existing
Resume:hint suggests a plain text reply. That loses constants such as the question'sseq: retrying an answer after a timeout can then answer the next question rather than the one originally shown. The server-side sequence check is already available in a2aproject/a2a-serve#447.For a tagged input schema with top-level constant properties, render a
--data-partJSON template that copies those constants and adds placeholders for required variable fields. For example, the numbered approval schema produces--data-part '{"option":"<option>","seq":2}'. Constant names are generic; no a2a-serve-specific flag or task refresh is added. Required constants are retained rather than overwritten, and null/false constants are recognized. The template preserves shell metacharacters using POSIX single-quote escaping.Ordinary text/auth-required hints and schemas without supported top-level constants retain their existing behavior. Update the bundled CLI skill to explain filling placeholders and retaining the same constants on retry. This covers existing Task resume hints; it does not add a new hint path for streamed status updates or implement full JSON Schema form generation. Agent addressing in resume hints remains separate work in #145.
Tests and validation
Go 1.26.11 on Windows:
go test ./internal/outputpasses. New table cases cover sequence constants, generic null/false constants, required constants, unchanged no-constant/array behavior, and shell quoting.TestSend_NumberedResumeReplyCanBeRetriedpasses over a local REST test agent: the generated answer advances question 1 to question 2, and replaying that same answer leaves question 2 waiting. The existing input-required resume-hint test also passes.go mod tidy -diff,go build ./..., andgolangci-lint run --new-from-rev=origin/mainpass (lint v2.11.4).go test ./... -count=1was run on both this patch and an untouched checkout of main at68149c8: the same failing test names/packages occur in both, with no new failures. The Windows failures concern existing file-URL handling, plugin/config discovery, and shell-command tests. The patch has 501 passing test/subtest records versus 493 on main. This is not a claim that the full suite passes.devkit/cliplugin/cliplugin.go,devkit/cliplugin/doc.go,internal/chat/session.go); changed-code lint reports 0 issues.AI-assisted implementation and regression tests. All stated checks were executed locally with synthetic input and local test agents; no external model APIs or real approval actions were used.