Fix form mode elicitation schema check to apply for all form requests#1151
Fix form mode elicitation schema check to apply for all form requests#1151
Conversation
…ut schema Co-authored-by: stephentoub <[email protected]>
tests/ModelContextProtocol.Tests/Protocol/UrlElicitationTests.cs
Outdated
Show resolved
Hide resolved
halter73
left a comment
There was a problem hiding this comment.
@copilot Please make this change.
Should we instead change the production code to check for missing
RequestedSchemafor all form mode requests, regardless of Form capability? That would require moving the schema check outside theForm is nullblock.Yes. But rather than moving the schema check out of the if block, I think
if (string.Equals(request.Mode, "form", StringComparison.Ordinal) && elicitationCapability.Form is null)should probably just be changed toif (string.Equals(request.Mode, "form", StringComparison.Ordinal)). We checkelicitationCapability.Form is nullagain before throwing anInvalidOperationException, so it was redundant.
Co-authored-by: halter73 <[email protected]>
Done in 9a2de43. Changed the condition to |
if (string.Equals(request.Mode, "form", StringComparison.Ordinal) && elicitationCapability.Form is null)toif (string.Equals(request.Mode, "form", StringComparison.Ordinal))FormElicitation_Requires_RequestedSchemato useElicitation = new()instead of explicit URL-only capabilityOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.