Skip to content

docs(extensions): describe maxLifetime replacement - #987

Open
ParidelPooya wants to merge 2 commits into
mainfrom
fix/agentcore-maxlifetime-docs
Open

ParidelPooya wants to merge 2 commits into
mainfrom
fix/agentcore-maxlifetime-docs

Conversation

@ParidelPooya

@ParidelPooya ParidelPooya commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What

Fix the AgentCore text that says the agent runtime's maxLifetime or idle timeout ends the session. Both end the session's instance.

Why

  1. The AgentCore lifecycle docs say maxLifetime is the maximum lifetime of the instance. The session can persist beyond it, with a new instance.
  2. The idle timeout (idleRuntimeSessionTimeout) also ends the instance after a time with no running job.
  3. agentcore_session checkpoints the runtime session ID and sends every job with it.
  4. So after maxLifetime or the idle timeout, the next job runs in a new instance of the same session. The memory and the files outside configured session storage are lost.
  5. A job that runs when the instance stops fails at its heartbeat timeout or its job timeout.

The text said that maxLifetime or the idle timeout ends the session, and that the whole session handler must fit within maxLifetime.

Change

Docstrings, comments, READMEs, and one log message. No behavior change.

  • AgentcoreSessionConfig: describe instance replacement. Drop the rule that the handler and its waits must fit within maxLifetime.
  • AgentcoreInvokeOptions.timeout: a job that runs when the instance stops fails at its heartbeat timeout or at this timeout.
  • AgentcoreConfig.timeout: say "instance" instead of "session". The rule to keep the timeout within maxLifetime stays.
  • AgentcoreConfig, AgentcoreSessionConfig.agent_runtime_arn, both READMEs: after the idle timeout with no running job, the same session ID gets a new instance (microVM) without the old memory and files.
  • operation.py, session.py, errors.py: the idle timeout ends the session's instance.
  • The stop failure log now says: "The session's instance keeps running until the idle timeout or maxLifetime ends it." No test asserts the old text.

Testing

  • AgentCore tests: 84 passed.
  • Extensions tests: 623 passed.
  • Compute-worker tests: 506 passed, 1 failed. The failure is test_create_raises_when_boto3_cannot_build_the_client, which fails only on this host.
  • mypy src tests: no issues in 49 (extensions) and 20 (compute-worker) source files.
  • hatch fmt --check: all files already formatted.
  • lintcommit.py --range origin/main..HEAD: pass.

Closes #986
Part of #954

Twin: aws/aws-durable-execution-sdk-js#1282

The agent runtime's maxLifetime ends the instance, not the session.
The next job with the same session ID gets a new instance. The
docstrings said that maxLifetime ends the session, and that the
session handler must fit within it.

Describe instance replacement in AgentcoreSessionConfig,
AgentcoreInvokeOptions.timeout and AgentcoreConfig.timeout.
The idle timeout and maxLifetime end the session's instance. The same
session ID then gets a new instance for the next job, without the old
memory and files. Fix the docstrings, comments, READMEs and the stop
failure log message that said the session ends.
@ParidelPooya
ParidelPooya marked this pull request as ready for review November 24, 2026 01:03
@ParidelPooya
ParidelPooya deployed to ai-pr-review-runtime November 24, 2026 01:03 — with GitHub Actions Active
@ParidelPooya
ParidelPooya deployed to ai-pr-review-runtime November 24, 2026 01:04 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

Codex AI review

One approach finding under rule 5 at packages/aws-durable-execution-sdk-python-extensions/src/aws_durable_execution_sdk_python_extensions/compute/agentcore/operation.py:464. No execution-logic regression identified. Tests were not run during this read-only review; the PR reports one compute-worker test failure.

Reviewed commit 4c4cf078d961d2850833b61a6db07bd74d138960. Workflow run

This branch was successfully deployed

1 active deployment
ai-pr-review-runtime — 4c4cf078 Deployed Nov 24, 2026 by ParidelPooya via ai-pr-review / Codex review / Generate Codex review #3401
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AgentCore session] Fix the maxLifetime docs

1 participant