feat: add runtime lifecycle configuration (idle timeout and max lifetime)#653
Merged
feat: add runtime lifecycle configuration (idle timeout and max lifetime)#653
Conversation
Contributor
Coverage Report
|
Hweinstock
previously approved these changes
Mar 26, 2026
Contributor
Hweinstock
left a comment
There was a problem hiding this comment.
looks like there are some merge conflicts, but otherwise looks good.
a261366 to
83810bc
Compare
Hweinstock
previously approved these changes
Mar 26, 2026
…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.
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.
- Extract LIFECYCLE_TIMEOUT_MIN/MAX constants from schema, use everywhere instead of hardcoded 60/28800 values (review comment 2) - Rename validateLifecycleOptions → parseAndValidateLifecycleOptions to clarify intent; return parsed values instead of mutating input (comment 3) - Unify create/add option types to number | string for consistency (comment 4)
83810bc to
bcc83c4
Compare
notgitika
approved these changes
Mar 26, 2026
aidandaly24
added a commit
to aidandaly24/agentcore-cli
that referenced
this pull request
Mar 27, 2026
Fix help text for options added in upstream PRs aws#652, aws#653, aws#657, aws#620: - dev: add [non-interactive] to --tool, --input, -H/--header - invoke: add [non-interactive] to -H/--header - fetch access: add [non-interactive] to --name, --type, --target, --json - copy.ts: add missing 'import' command description Confidence: high Scope-risk: narrow
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