Skip to content

feat(provider): expose request metadata and header helpers - #4144

Merged
onbjerg merged 2 commits into
mainfrom
centaur/provider-call-headers-1786654334
Aug 14, 2026
Merged

feat(provider): expose request metadata and header helpers#4144
onbjerg merged 2 commits into
mainfrom
centaur/provider-call-headers-1786654334

Conversation

@decofe

@decofe decofe commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Motivation

Typed Provider methods return ProviderCall, which did not expose the request metadata mapping available on the underlying RpcCall. Callers that need request-scoped HTTP headers therefore had to drop down to the raw RPC client or manually unwrap the inner call.

Solution

  • Add ProviderCall::map_meta, forwarding metadata changes to the underlying RpcCall.
  • Add fluent with_headers and with_header helpers for request-scoped HTTP headers.
  • Return the original call when metadata cannot be changed, matching the fallible map_resp API.
  • Document per-request HTTP header usage and cover RPC and non-RPC variants.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Prompted by: @onbjerg

Co-authored-by: Derek Cofausper <256792747+decofe@users.noreply.github.com>
Co-authored-by: Derek Cofausper <256792747+decofe@users.noreply.github.com>
@decofe decofe changed the title feat(provider): expose request metadata mapping feat(provider): expose request metadata and header helpers Aug 13, 2026
@github-project-automation github-project-automation Bot moved this to Reviewed in Alloy Aug 13, 2026
@onbjerg
onbjerg merged commit bcd9e67 into main Aug 14, 2026
30 checks passed
@onbjerg
onbjerg deleted the centaur/provider-call-headers-1786654334 branch August 14, 2026 14:22
@github-project-automation github-project-automation Bot moved this from Reviewed to Done in Alloy Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants