Skip to content

fix(bedrock_agentcore_starter_toolkit): type mismatch: api_key_env_var_name declared optional[str] but defaults to false (bool) #523

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions