Repository navigation
feat(extensions): label the agentcore_session context - #978
Draft
ParidelPooya wants to merge 2 commits into
Draft
ParidelPooya wants to merge 2 commits into
ParidelPooya wants to merge 2 commits into
Conversation
The agentcore_session child context now records the subtype AgentcoreSession, the same value as the JavaScript SDK. The steps and the job operations keep their subtypes. A job's own child context keeps the default subtype, as in microvm_session. This changes the recorded history of agentcore_session. The API is experimental and not released. Closes #945
Each AgentcoreSession.invoke job now records the subtype AgentcoreSessionJob on its child context. The JavaScript SDK records the same subtype, so both SDKs write the same execution history.
hln33
approved these changes
Nov 23, 2026
This branch has not been deployed
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.
What
The
agentcore_sessionchild context records the subtypeAgentcoreSession. Each job's child context records the subtypeAgentcoreSessionJob.Why
Execution history and plugins filter operations by subtype. Every other
agentcore_sessionoperation has an AgentCore subtype, but the session child context and each job's child context had only the defaultRunInChildContext. So a consumer could not find a session or a job without parsing operation names.Change
AgentcoreOperationSubType.SESSION = "AgentcoreSession"andAgentcoreOperationSubType.SESSION_JOB = "AgentcoreSessionJob". The values are the same as in the JavaScript SDK.agentcore_sessionpassesChildConfig(sub_type=AgentcoreOperationSubType.SESSION)to its child context.AgentcoreSession.invokepassesChildConfig(sub_type=AgentcoreOperationSubType.SESSION_JOB)to each job's child context.agentcore()subtype values do not change. The session steps, the job callbacks and the job request steps keep their subtypes.AgentcoreSessionJob. So both SDKs record the same history.This changes the recorded history of
agentcore_session. The API is experimental and not released, so no execution in flight depends on the old value.Decisions the issue did not cover
AgentcoreSessionJob. This departs from the issue text "Jobs keep the existing subtypes", to match feat(extensions): label the agentcoreSession child context aws-durable-execution-sdk-js#1273 and the JSmicrovmSessionpair. The job's callback and request steps keep their existing subtypes.microvm_sessionrecords no subtypes yet, on its session or its jobs. That gap is separate and existed before this PR.test_labels_every_operation_with_its_subtypeinagentcore_operation_test.pycompared every enum value with theagentcore()operations. The newSESSIONandSESSION_JOBvalues are notagentcore()operations. So that check now leaves out both.Testing
test_labels_every_operation_with_its_subtypeinagentcore_session_test.pyruns a session with two jobs. It lists each of the 9 operations with its subtype, from the result tree and from every history event.'review': 'RunInChildContext' != 'AgentcoreSession'). With it restored, the test passes.SESSION_JOBininvoke, the new test fails ('build': 'RunInChildContext' != 'AgentcoreSessionJob', same fortest). With it restored, the test passes.mypy src tests: no issues.hatch fmt --check: passed.lintcommit.py --range origin/main..HEAD: passed.Closes #945
Part of #954
Twin: aws/aws-durable-execution-sdk-js#1236