Skip to content

Do not negotiate a binary encoding outside the advertised intersection #51

@nficano

Description

@nficano

CapabilityNegotiation says the negotiated capability set is the intersection of client and runtime support, but negotiateBinaryEncoding violates that rule. At lib/src/main/kotlin/dev/arcp/runtime/CapabilityNegotiation.kt:64, the function computes the intersection and then returns listOf("base64") when the intersection is empty. If a client advertises only ["raw"] and the runtime advertises only ["base64"], the negotiated result still says base64, which is not supported by the client. No unit test currently covers binary encoding negotiation.

Fix prompt: Preserve the default ["base64"] for omitted/default capability blocks, but do not invent base64 when both sides explicitly advertise incompatible non-empty lists. Return an empty list or add a capability negotiation rejection for incompatible binary encodings, especially when binaryStreams or artifact support depends on an encoding. Add tests for matching encodings, default values, explicitly empty lists, and incompatible lists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingseverity:mediumMedium severity issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions