fix(bedrock): drop Final on reassigned local to satisfy type gate

final_name is assigned in both branches of the length check, so annotating
it Final tripped basedpyright's reportGeneralTypeIssues (cannot reassign a
Final) and failed the type-check budget gate. Make it a plain local.

Signed-off-by: Leonard Hu <leonhu@amazon.com>
This commit is contained in:
Leonard Hu 2026-09-24 11:17:42 -04:00
parent dc37d1ec67
commit 2d50e37553

View file

@ -4996,7 +4996,7 @@ def make_valid_bedrock_tool_name(input_tool_name: str) -> str:
if len(valid_string) > BEDROCK_MAX_TOOL_NAME_LENGTH:
name_hash = hashlib.sha256(valid_string.encode()).hexdigest()[:8]
prefix_length = BEDROCK_MAX_TOOL_NAME_LENGTH - len(name_hash) - 1
final_name: Final = f"{valid_string[:prefix_length]}_{name_hash}"
final_name = f"{valid_string[:prefix_length]}_{name_hash}"
else:
final_name = valid_string