fix(bedrock): make tool-name limit a fixed constant, not an env var

Bedrock Runtime's 64-char tool-name limit is a fixed AWS API constraint,
not a per-deployment tunable. Reading it via os.getenv introduced an
undocumented env var, which failed the documentation_test_env_keys code
quality check. Define it as a plain constant instead.

Signed-off-by: Leonard Hu <leonhu@amazon.com>
This commit is contained in:
Leonard Hu 2026-09-24 10:53:41 -04:00
parent 5ad9dc96e2
commit dc37d1ec67

View file

@ -508,7 +508,9 @@ NON_LLM_CONNECTION_TIMEOUT: Final = int(
MAX_EXCEPTION_MESSAGE_LENGTH: Final = int(os.getenv("MAX_EXCEPTION_MESSAGE_LENGTH", 2000))
MAX_STRING_LENGTH_PROMPT_IN_DB: Final = int(os.getenv("MAX_STRING_LENGTH_PROMPT_IN_DB", 2048))
BEDROCK_MAX_POLICY_SIZE: Final = int(os.getenv("BEDROCK_MAX_POLICY_SIZE", 75))
BEDROCK_MAX_TOOL_NAME_LENGTH: Final = int(os.getenv("BEDROCK_MAX_TOOL_NAME_LENGTH", 64))
# Bedrock Runtime hard-limits tool names to 64 characters; this is a fixed AWS API
# constraint, not a tunable, so it is a plain constant rather than an env var.
BEDROCK_MAX_TOOL_NAME_LENGTH: Final = 64
# One entry per distinct AWS credential-argument set. Per-user cost attribution passes the attributed
# identity as aws_session_name, so this bounds how many attributed identities keep a cached STS session.
BEDROCK_IAM_CACHE_MAX_ENTRIES: Final = 1000