Skip to content

[Client] Fill elicitation defaults when accepting - #462

Merged
chr-hertel merged 1 commit into
modelcontextprotocol:mainfrom
wWzZb:agent/issue-328-elicitation-defaults
Oct 7, 2026
Merged

chr-hertel merged 1 commit into
modelcontextprotocol:mainfrom
wWzZb:agent/issue-328-elicitation-defaults

Conversation

@wWzZb

@wWzZb wWzZb commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

A client accepting elicitation/create without explicit field values currently has to rebuild the request schema's defaults itself. The conformance client instead returned empty content, even though each supported definition already exposes default.

ElicitationSchema::extractDefaults() now provides the canonical field => default map, preserves falsey values such as 0 and false, and skips fields with no default. The conformance client uses that map when accepting. Coverage includes string, integer/number, enum, titled enum, and boolean definitions.

I left out the optional ElicitResult::accepted() factory because the helper and existing constructor cover the path without adding another public entry point.

The elicitation-sep1034-client-defaults runner still times out on current main before the handler runs: the server sends elicitation/create on the standalone SSE stream, while HttpTransport does not yet open the GET stream tracked by #327. Its expected-failure entry therefore stays in place. The 2026-07-28 sep-2322-client-request-state scenario, which exercises the same handler path, passes 5/5.

Checks:

  • vendor/bin/phpunit — 1686 tests, 4377 assertions, 7 existing skips
  • vendor/bin/phpstan analyse --memory-limit=-1
  • vendor/bin/php-cs-fixer fix --dry-run --diff --verbose
  • make docs
  • composer validate --strict
  • sep-2322-client-request-state conformance — 5/5

Fixes #328

@chr-hertel chr-hertel added the Client Issues & PRs related to the Client component label Sep 7, 2026
@chr-hertel
chr-hertel force-pushed the agent/issue-328-elicitation-defaults branch from 9eb6d91 to 71ff155 Compare October 6, 2026 23:56
@chr-hertel
chr-hertel force-pushed the agent/issue-328-elicitation-defaults branch from 71ff155 to db16d95 Compare October 6, 2026 23:59

@chr-hertel chr-hertel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @wWzZb! minor rework while merging incl changelog entry

@chr-hertel
chr-hertel merged commit a5ed85f into modelcontextprotocol:main Oct 7, 2026
27 checks passed
@chr-hertel chr-hertel added the breaking change Breaking the Backwards Compatibility Promise label Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Breaking the Backwards Compatibility Promise Client Issues & PRs related to the Client component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Client] Fill elicitation defaults when accepting (SEP-1034)

2 participants