litellm - ✅(Solved) Fix [Bug]: A2A convention-based header forwarding not working [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#28267Fetched 2026-05-20 03:40:23
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×2cross-referenced ×1referenced ×1

Fix Action

Fixed

PR fix notes

PR #28311: fix(a2a): forward agent_extra_headers through completion bridge for custom_llm_provider agents

Description (problem / solution / changelog)

Root Cause

When an A2A agent is configured with custom_llm_provider (e.g. LangGraph, Bedrock AgentCore), asend_message and asend_message_streaming route through _send_message_via_completion_bridge instead of the native A2A client path.

The native path correctly merges agent_extra_headers into the HTTP client:

if agent_extra_headers:
    extra_headers.update(agent_extra_headers)
a2a_client = await create_a2a_client(base_url=api_base, extra_headers=extra_headers)

The completion-bridge path silently drops them:

return await _send_message_via_completion_bridge(
    request=request,
    custom_llm_provider=custom_llm_provider,
    api_base=api_base,
    litellm_params=litellm_params,
    # agent_extra_headers not passed!
)

The same problem exists in asend_message_streaming before its handle_streaming call.

Impact

  • Method 3 convention-based headers (x-a2a-{alias}-{target}) are dropped for all LangGraph/completion-bridge agents.
  • Admin-allowlisted extra_headers configured on the agent are never forwarded.

Fix

  1. Add agent_extra_headers: Optional[Dict[str, str]] = None to _send_message_via_completion_bridge.
  2. Before calling the bridge handler, shallow-copy litellm_params and merge agent_extra_headers into its extra_headers key — this flows through to litellm.acompletion(**completion_params) because the handler already does completion_params.update(litellm_params_to_add).
  3. Pass agent_extra_headers from asend_message to the bridge call.
  4. Apply the same merge in the custom_llm_provider branch of asend_message_streaming before handle_streaming.

Test Plan

  • Configure a LangGraph agent with custom_llm_provider: langgraph
  • Send a request with x-a2a-<agent-name>-authorization: Bearer token header
  • Verify the Authorization header reaches the downstream LangGraph backend
  • Same test for admin-allowlisted extra_headers on the agent config
  • Verify standard A2A agents (no custom_llm_provider) are unaffected

Fixes #28267

Changed files

  • litellm/a2a_protocol/main.py (modified, +16/-0)
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

When a LangGraph agent (or any agent using custom_llm_provider) is configured with Method 3 convention-based header forwarding (x-a2a-{alias}-{target}), the forwarded headers are silently dropped and never reach the downstream backend.

Admin-allowlisted headers (extra_headers on the agent config) are also affected.

Steps to Reproduce

Configure a LangGraph agent in the proxy and send a request with:

x-a2a-my-agent-authorization: Bearer my-token The Authorization header will not be forwarded to the LangGraph backend despite the agent name matching.

Relevant log output

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

1.85.0

Twitter / LinkedIn details

https://www.linkedin.com/in/maarmenta/

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - ✅(Solved) Fix [Bug]: A2A convention-based header forwarding not working [1 pull requests, 1 participants]