fix(everything): fix stale field names, unused pollInterval, and duplicated validation#4189
Open
1060996408 wants to merge 1 commit into
Conversation
…icated validation Fix 3 bugs in the everything reference server: 1. **trigger-elicitation-request.ts**: Display code referenced stale field names (userData.check, userData.color, userData.petType) that don't match the requestedSchema. Updated to use correct field names: agreeToTerms, firstLine, untitledSingleSelectEnum, untitledMultipleSelectEnum, titledSingleSelectEnum, titledMultipleSelectEnum, legacyTitledEnum. 2. **trigger-*-request-async.ts**: Both async tools hardcoded POLL_INTERVAL instead of using the pollInterval from the CreateTaskResult response. Now uses server-provided pollInterval with fallback to the constant default. 3. **resources/templates.ts + prompts/resource.ts**: Extracted shared validateResourceId() from duplicated inline validation logic in parseResourceId (private) and the resource-prompt handler. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Description
Fix 3 bugs in the
everythingreference server: stale elicitation display fields, ignoredpollIntervalin async tools, and duplicated resource ID validation logic.Server Details
Motivation and Context
trigger-elicitation-request.ts: The display code after elicitation completes referenced stale field names (userData.check,userData.color,userData.petType) that don't match the actualrequestedSchemadefined earlier in the same file. Users see missing or wrong data in the tool output.trigger-sampling-request-async.tsandtrigger-elicitation-request-async.ts: Both async tools hardcodePOLL_INTERVAL(1000ms) when polling for task status, completely ignoring thepollIntervalfield that the client returns in theCreateTaskResult. This means the server can't respect the client's preferred polling cadence.resources/templates.ts+prompts/resource.ts: Resource ID validation (positive integer check) is duplicated between the privateparseResourceIdfunction and theresource-prompthandler. Extracted a sharedvalidateResourceId()utility.How Has This Been Tested?
npx vitest run— all 38 tests pass (3 failures are pre-existingz.url/z.looseObjectissues ingzip-file-as-resource.ts, unrelated to these changes)z.url/z.looseObjectfailures reproduce on clean upstream code without my changesgzip-file-as-resource.tsand the async tools'z.looseObjectcalls are pre-existing upstream issues (Zod v3 doesn't havez.url()orz.looseObject())Breaking Changes
None. All changes are backward-compatible bug fixes.
Types of changes
Checklist
Additional context
The
z.url()andz.looseObject()build/test failures are pre-existing issues caused by the upstream code using Zod v4 APIs while the repo's lockfile still pins Zod v3. These are not introduced by this PR and will be resolved when the Zod v4 migration is completed (see #4136).