Skip to content

pctx_config 0.1.4 fails to compile with rmcp >= 1.3.0 due to #[non_exhaustive] on StreamableHttpClientTransportConfig #67

@wpfleger96

Description

@wpfleger96

pctx_config 0.1.4 constructs StreamableHttpClientTransportConfig using struct literal syntax at server.rs:172:

StreamableHttpClientTransportConfig {
    uri: http_cfg.url.as_str().into(),
    ..Default::default()
},

rmcp added #[non_exhaustive] to StreamableHttpClientTransportConfig in modelcontextprotocol/rust-sdk#715 (with additional structs covered in #768), which shipped in the rmcp 1.3.0 release. This is technically a SemVer-breaking change on rmcp's side — adding #[non_exhaustive] to a previously-exhaustive public struct breaks external crates that use struct literal syntax (E0639). That said, rmcp provides StreamableHttpClientTransportConfig::with_uri() as the intended construction path, and switching to it would make pctx_config compatible with both current and future rmcp versions.

Any workspace that depends on both pctx_config and rmcp >= 1.3.0 hits this:

error[E0639]: cannot create non-exhaustive struct using struct expression
   --> pctx_config-0.1.4/src/server.rs:172:21
    |
172 | /                     StreamableHttpClientTransportConfig {
173 | |                         uri: http_cfg.url.as_str().into(),
174 | |                         ..Default::default()
175 | |                     },
    | |_____________________^

We're hitting this in block/goose while trying to bump rmcp to pick up new transport features (rust-sdk#749).

Fix: replace the struct literal with the builder method that rmcp provides:

// before
StreamableHttpClientTransportConfig {
    uri: http_cfg.url.as_str().into(),
    ..Default::default()
},

// after
StreamableHttpClientTransportConfig::with_uri(http_cfg.url.as_str()),

Happy to open a PR if that works for you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions