Skip to content

[Client] Fill elicitation defaults when accepting - #462

Open
wWzZb wants to merge 1 commit into
modelcontextprotocol:mainfrom
wWzZb:agent/issue-328-elicitation-defaults
Open

[Client] Fill elicitation defaults when accepting#462
wWzZb wants to merge 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant