From dc37d1ec67a1cbcac0200050c2dbb2e02a0cee31 Mon Sep 17 00:00:00 2001 From: Leonard Hu Date: Thu, 24 Sep 2026 10:53:41 -0400 Subject: [PATCH] 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 --- litellm/constants.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/litellm/constants.py b/litellm/constants.py index bcce59e2ec8..02bc4be859f 100644 --- a/litellm/constants.py +++ b/litellm/constants.py @@ -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