aws / aws/bedrock-agentcore-starter-toolkit
[BUG] Custom headers are not passed along by agentcore invoke in dev mode
- Dominant language
- Python
- Stars
- 508
- Forks
- 155
- Avg merge
- 8h 50m
- Merged PRs (30d)
- 4
Description
**Describe the bug**
When running `agentcore invoke` with the --dev flag, headers are not passed along to the dev mode server. Is there a reason for this?
**To Reproduce**
Steps to reproduce the behavior:
Create an agent and try to load in a custom header
```
req_headers = getattr(context, 'request_headers', None) or {}
custom_value = req_headers.get("x-amzn-bedrock-agentcore-runtime-custom-value")
```
Start the agent in development mode
```
uv run agentcore dev
```
Invoke the agent in dev mode
```
uv run agentcore invoke --dev "Do something useful" --headers "value:awesome"
```
**Expected behavior**
`custom_value` should have the value awesome
**Error Output**
`custom_value` is empty
**Additional context**
Example fix here: https://github.com/gopangea/bedrock-agentcore-starter-toolkit/tree/tl-allow-custom-headers-in-dev-mode
Contributor guide
Research direction
Reproduce the issue with `uv run agentcore dev` and `uv run agentcore invoke --dev "Do something useful" --headers "value:awesome"`. Trace how `agentcore invoke --dev` forwards headers to the development server and compare the behavior with the example fix linked in the issue. Done when the agent reads `awesome` from `context.request_headers`.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100