feat: AGENT_RUNTIME feature flag — Lambda/Fargate/both compute selection#19
Open
tobigs wants to merge 9 commits intoserithemage:mainfrom
Open
feat: AGENT_RUNTIME feature flag — Lambda/Fargate/both compute selection#19tobigs wants to merge 9 commits intoserithemage:mainfrom
tobigs wants to merge 9 commits intoserithemage:mainfrom
Conversation
The Telegram bot system prompt in bridge.ts was in Korean, causing the AI to respond in Korean. Also translated all other user-facing Korean strings across gateway handlers, identity service, container startup notifications, monitoring dashboard descriptions, web UI, and tests.
ComputeStack is not deployed in lambda mode, so the SSM parameters it writes (cluster-arn, task-definition-arn, etc.) don't exist. ApiStack now conditionally reads them and skips Fargate IAM grants (ecs:RunTask, iam:PassRole) when agentRuntime is 'lambda'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- identity.ts: guard Fargate task-state lookup in verifyOtpAndLink behind agentRuntime !== "lambda" to avoid spurious DynamoDB reads - telegram-webhook.ts: skip cold-start task-state check when Lambda runtime; pass agentRuntime to verifyOtpAndLink and routeMessage; add structured console logging throughout for observability - ws-message.ts: pass agentRuntime, invokeLambdaAgent, and lambdaAgentFunctionArn to routeMessage - telegram-webhook.test.ts: update verifyOtpAndLink call expectation to include agentRuntime option Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- watchdog/prewarm handlers: early-return when AGENT_RUNTIME=lambda - E2E test: remove stale cluster/taskDefinition props from ApiStack - .env.example: document AGENT_RUNTIME with valid values
- message.ts: add onLambdaResponse callback to RouteDeps so callers handle delivery after a successful Lambda invocation - ws-message.ts: push each payload as a WebSocket message + send status:running before invoke and status:Idle after - telegram-webhook.ts: send each payload text back via Telegram - stacks.e2e.test.ts: fix unused variable in PREWARM_SCHEDULE test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…bda-only mode - Make ApiStack vpc/fargateSecurityGroup props optional - Conditionally include Fargate env vars (ECS_CLUSTER_ARN, TASK_DEFINITION_ARN, SUBNET_IDS, SECURITY_GROUP_IDS) only when fargateEnabled - Skip NetworkStack creation when AGENT_RUNTIME=lambda - Add agentRuntime prop to MonitoringStack, exclude Fargate dashboard widgets (Cold Start, Pre-Warming, ECS CPU/Memory) in lambda-only mode - Add bug condition exploration and preservation E2E tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an
AGENT_RUNTIMEenvironment variable (fargate|lambda|both, defaultfargate) that controls which compute backend handles agent requests:fargate(default): existing Fargate path, no changelambda: skips all Fargate infrastructure (NetworkStack/VPC not created, no ECS SSM lookups, watchdog/prewarm early-return)both: smart routing — Lambda by default, Fargate reuse when already running,/heavy//fargatehint for Fargate, Lambda failure fallback to FargateChanges
ApiStack: conditionally reads Fargate SSM params (cluster-arn,task-definition-arn, etc.) and skips ECS IAM grants whenAGENT_RUNTIME=lambdatelegram-webhook.ts/identity.ts: guard Fargate task-state checks behindagentRuntime !== "lambda"watchdog.ts/prewarm.ts: early-return whenAGENT_RUNTIME=lambdacdk/bin/app.ts: skipNetworkStackcreation for lambda-only modeMonitoringStack: exclude Fargate dashboard widgets (cold start, ECS CPU/Memory, pre-warming) in lambda-only mode.env.example: documentsAGENT_RUNTIMEwith valid valuesDependencies
Test plan
🤖 Generated with Claude Code