Skip to content

SEP-1577 sampling follow-up: invariants, validator messages, conformance #730

@devcrocod

Description

@devcrocod

Polish items deferred from #718

Tasks

  • Enforce non-empty content in SamplingMessage and CreateMessageResult via init { require(content.isNotEmpty()) }.
    kotlin-sdk-core/.../types/sampling.kt — refs r3142638028, r3142638034

  • Fix validateSamplingMessages KDoc — it claims no-op for <2 messages, but a single message with tool_result throws.
    kotlin-sdk-server/.../SamplingValidation.kt — ref r3142638012

  • **Better error when tool_result is missing — currently throws "ids do not match" with an empty set; add an explicit require(toolResultIds.isNotEmpty()) first.
    kotlin-sdk-server/.../SamplingValidation.kt — ref r3142638015

  • test_sampling conformance tool returns TextContent(text=…, type=…) instead of the sampled text — extract TextContent.text, handle non-text blocks explicitly.
    conformance-test/.../ConformanceTools.kt — ref r3142638007

related to #409

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Nice to haves, rare edge casesenhancementNew feature or requestgood first issueGood for newcomersready for workHas enough information to start

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions