Commit d5af72c
committed
fix(dev): forward custom headers from web UI proxy to local agent
The Agent Inspector web UI proxy (handleInvocations) constructs new
headers when proxying to the local Python/TS agent but never reads
or forwards req.headers from the incoming request. This causes all
x-amzn-bedrock-agentcore-runtime-custom-* headers to be silently
dropped.
The direct CLI invoke path already does this correctly via
...customHeaders spread — this patch brings the web UI proxy path
to parity.
Also applies the same fix to handleAguiInvocation which has the
same issue.
Reproduction:
1. agentcore create --name Test --framework Strands --model-provider Bedrock --protocol HTTP
2. agentcore dev (launches Inspector on 8081, agent on 8082)
3. curl -X POST http://localhost:8081/invocations -H 'X-Agentcore-Local: true' -H 'X-Amzn-Bedrock-AgentCore-Runtime-Custom-MyHeader: test-value' -H 'Content-Type: application/json' -d '{"prompt":"Hello"}'
4. Observe: custom header is NOT received by the Python agent
5. After fix: custom header IS received
Tested on CLI v0.25.0, Node.js 23.11.0, macOS ARM64.1 parent 8fba816 commit d5af72c
1 file changed
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
14 | 29 | | |
15 | 30 | | |
16 | 31 | | |
| |||
84 | 99 | | |
85 | 100 | | |
86 | 101 | | |
87 | | - | |
| 102 | + | |
88 | 103 | | |
89 | 104 | | |
90 | 105 | | |
| |||
96 | 111 | | |
97 | 112 | | |
98 | 113 | | |
| 114 | + | |
| 115 | + | |
99 | 116 | | |
100 | 117 | | |
101 | 118 | | |
| |||
277 | 294 | | |
278 | 295 | | |
279 | 296 | | |
| 297 | + | |
280 | 298 | | |
281 | 299 | | |
282 | 300 | | |
| |||
314 | 332 | | |
315 | 333 | | |
316 | 334 | | |
| 335 | + | |
| 336 | + | |
317 | 337 | | |
318 | 338 | | |
319 | 339 | | |
| |||
0 commit comments