aws / aws/bedrock-agentcore-starter-toolkit
fix(bedrock_agentcore_starter_toolkit): type mismatch: api_key_env_var_name declared optional[str] but defaults to false (bool)
- Dominant language
- Python
- Stars
- 508
- Forks
- 155
- Avg merge
- 8h 50m
- Merged PRs (30d)
- 4
Description
## Description
The field `api_key_env_var_name` is annotated as `Optional[str]` but its default value is `False`, which is a `bool`. This is a silent type violation. Any downstream code that performs string operations on this field (e.g., `os.environ[api_key_env_var_name]` or string formatting) will fail at runtime when the default is used. With mypy configured in strict mode (`disallow_untyped_defs`, `warn_return_any`), this will also be flagged as a type error. The intended default is almost certainly `None` (meaning "not set").
**Severity**: `medium`
**File**: `src/bedrock_agentcore_starter_toolkit/create/types.py`
## Expected Behavior
The code should handle this case properly to avoid unexpected errors or degraded quality.
Contributor guide
Research direction
Open src/bedrock_agentcore_starter_toolkit/create/types.py and inspect the api_key_env_var_name declaration, including its annotation and default. Confirm the default is consistent with Optional[str], then run the project's type checks or tests to verify the mismatch is resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100