- Clone header maps in WithMCPHeaders/MCPHeaders to prevent concurrent
mutation (maps are shared across goroutines via context).
- Trim whitespace from header names extracted from InboundContext.Raw
to prevent invalid HTTP header names.
- Add unit tests for headerTransport dynamic header injection:
dynamic-only, dynamic-overrides-static, and no-dynamic passthrough.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Channels can now pass HTTP headers to MCP servers on a per-request basis
by storing keys with a "mcp:" prefix in InboundContext.Raw. This enables
forwarding bearer tokens from channel authentication to MCP tool calls.
The context flows: Channel → InboundContext.Raw["mcp:Authorization"]
→ toolshared.MCPHeaders(ctx) → headerTransport.RoundTrip → HTTP header.
SSE/HTTP transports now always use headerTransport (previously only when
static headers were configured) so dynamic headers work out of the box.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use fmt.Sprintf fallback instead of {} on encoding errors
- Normalize nil args to {} in FormatArgsJSON for consistent output
- Update tests to expect {} instead of null for nil args
Based on PR #2670 review feedback from afjcjsbx
- Add PrettyPrint and DisableEscapeHTML config options to ToolFeedbackConfig
- Add FormatArgsJSON helper function with configurable pretty printing and HTML escaping
- Add toolFeedbackArgsPreviewWithOptions to pass formatting options
- Update pipeline_execute.go to use new formatting options for tool feedback
This fixes the issue where '&&' would be displayed as '\u0026' in tool
feedback messages and provides optional pretty-printing for better
readability.