feat: add runtime lifecycle configuration (idle timeout and max lifetime)#653
Open
feat: add runtime lifecycle configuration (idle timeout and max lifetime)#653
Conversation
…ime) Add --idle-timeout and --max-lifetime flags to create/add commands, with full TUI support in both GenerateWizard (create) and AddAgent (BYO) flows. Values map to lifecycleConfiguration in the agent schema and flow through to the CDK construct. Includes schema validation (60-28800s range, idle <= max), CLI flag validation, E2E test support with AWS API verification, integration tests, and TUI integration tests.
Contributor
Coverage Report
|
The strands-bedrock e2e test reuses an existing deployed runtime that was created without lifecycle config. Adding lifecycle assertions to it causes failures because the already-deployed runtime has default values (900s) rather than the overridden ones (120s). Runtime lifecycle configuration should be validated via a dedicated test, not by modifying shared framework 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 runtime lifecycle configuration support, allowing users to control idle session timeout and max instance lifetime for agent runtimes. Both values are optional and accept a range of 60-28800 seconds.
--idle-timeoutand--max-lifetimeCLI flags oncreateandadd agentcommandslifecycle-utils.tsvalidation module used by both CLI and TUI pathslifecycleConfigurationinagentcore.jsonand passed through to CDKTUI: Advanced flow with lifecycle steps
When a user selects "Yes, customize" in the Advanced settings step, the breadcrumb expands to include Idle Timeout and Max Lifetime:
TUI: Idle Timeout input
TUI: Max Lifetime input
TUI: Review screen showing lifecycle values
CLI flags
CDK Companion PR
https://github.com/aws/agentcore-l3-cdk-constructs/pull/109
Test plan
lifecycle-utils.tsvalidation (15 tests)lifecycleConfigurationinAgentEnvSpecSchema(cross-field superRefine)useGenerateWizardunit tests for lifecycle state managementcreateandaddcommand validation tests for--idle-timeout/--max-lifetimeschema-mappertests verifying lifecycle config flows to agent specagentcore.jsonGetAgentRuntimeAPI