Repository navigation
docs: show the decline branch in the lead input_required example - #2999
Open
yy5652-hash wants to merge 1 commit into
Open
yy5652-hash wants to merge 1 commit into
yy5652-hash wants to merge 1 commit into
Conversation
The first example a developer meets (the inputRequired JSDoc and the opening of docs/servers/input-required.md) tests only for an accepted answer, so a declined or cancelled confirmation returns inputRequired() again: the client re-asks on every retry until inputRequired.maxRounds, and the operator is put the same question eight times. Read the response with inputResponse() first and finish on any answer; the test pins the one-round behaviour for decline and cancel. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
This branch has not been deployed
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.
docs: show the decline branch in the lead input_required example
What
The first
input_requiredexample a developer meets, in theinputRequiredJSDoc (packages/core-internal/src/shared/inputRequired.ts) and at the top ofdocs/servers/input-required.md(examples/guides/servers/input-required.examples.ts#registerTool_inputRequired), tests only for an accepted answer:acceptedContentreturnsundefinedfor a declined or cancelled answer just as it does on the first entry, so a decline makes the handler returninputRequired()again. The client re-asks on every retry untilinputRequired.maxRounds, the operator is put the same question eight times, and then the call fails with "Multi-round-trip request 'tools/call' still required input after 8 rounds". The server sees no error at any point.The guide already explains this further down ("Read the responses on re-entry") and
inputResponse()exists for exactly this; the lead example just does not use it, and it is the one that gets copied. We copied it into a hackathon server and shipped the loop.Change
inputResponse()first and finishes on any elicitation answer: accepted → act; declined or cancelled → anisErrorresult. The request is only re-issued when nothing has arrived.acceptedContentalone cannot tell a refusal from a first entry.packages/server/test/server/inputRequired.test.tspins the one-round behaviour fordeclineandcancelon the 2026-07-28 era through the real server funnel, and records thatacceptedContentreads both asundefined.No runtime code changes; no changeset added.
pnpm sync:snippets --check, the server and core-internal test suites and lint pass locally. The markdown page was not prettier-clean before this change (unrelated long lines), and that is left as it was.🤖 Generated with Claude Code