Description
The googleadk, langchain_langgraph, and openaiagents gateway client.py templates generate syntactically invalid Python whenever a gateway uses the NONE authorizer type. The auth-type {{#if}}/{{else}}/{{/if}} Handlebars block is indented inside an if url: clause that is immediately followed by else:; the indented control tags leave stray whitespace that over-indents the Python else: (rendering else: instead of else:), producing an IndentationError at import time.
NONE is a valid, user-reachable gateway authorizer type (GatewayAuthorizerTypeSchema = z.enum(['NONE', 'AWS_IAM', 'CUSTOM_JWT'])), so any agent with a no-auth gateway in one of these frameworks fails to run. Strands is structurally immune (it uses an if not url: return None shape with no trailing Python else:).
Steps to Reproduce
agentcore create --project-name demo --no-agent
agentcore add gateway --name public --authorizer-type NONE
agentcore add gateway-target --gateway public --name a --type mcp-server --endpoint https://mcp.exa.ai/mcp
agentcore add agent --name demo --framework GoogleADK --model-provider Bedrock --memory none (also reproduces with LangChain_LangGraph and OpenAIAgents)
- Inspect
app/demo/mcp_client/client.py — or run the agent
Expected Behavior
The generated client.py is valid Python with the else: at the correct 4-space indent, for every authorizer type including NONE.
Actual Behavior
The rendered client.py contains an over-indented else:, raising IndentationError: unexpected indent when the module is imported.
CLI Version
main (0.19.0)
Operating System
Linux
Additional Context
Root cause is indented standalone Handlebars control tags. Moving {{#if}}/{{else}}/{{/if}} to column 0 makes Handlebars strip them as standalone lines, keeping the Python else: correctly indented. Fixed in #1518.
Description
The
googleadk,langchain_langgraph, andopenaiagentsgatewayclient.pytemplates generate syntactically invalid Python whenever a gateway uses theNONEauthorizer type. The auth-type{{#if}}/{{else}}/{{/if}}Handlebars block is indented inside anif url:clause that is immediately followed byelse:; the indented control tags leave stray whitespace that over-indents the Pythonelse:(renderingelse:instead ofelse:), producing anIndentationErrorat import time.NONEis a valid, user-reachable gateway authorizer type (GatewayAuthorizerTypeSchema = z.enum(['NONE', 'AWS_IAM', 'CUSTOM_JWT'])), so any agent with a no-auth gateway in one of these frameworks fails to run. Strands is structurally immune (it uses anif not url: return Noneshape with no trailing Pythonelse:).Steps to Reproduce
agentcore create --project-name demo --no-agentagentcore add gateway --name public --authorizer-type NONEagentcore add gateway-target --gateway public --name a --type mcp-server --endpoint https://mcp.exa.ai/mcpagentcore add agent --name demo --framework GoogleADK --model-provider Bedrock --memory none(also reproduces with LangChain_LangGraph and OpenAIAgents)app/demo/mcp_client/client.py— or run the agentExpected Behavior
The generated
client.pyis valid Python with theelse:at the correct 4-space indent, for every authorizer type includingNONE.Actual Behavior
The rendered
client.pycontains an over-indentedelse:, raisingIndentationError: unexpected indentwhen the module is imported.CLI Version
main (0.19.0)
Operating System
Linux
Additional Context
Root cause is indented standalone Handlebars control tags. Moving
{{#if}}/{{else}}/{{/if}}to column 0 makes Handlebars strip them as standalone lines, keeping the Pythonelse:correctly indented. Fixed in #1518.