@aws/agentcore 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1889,6 +1889,7 @@ exports[`Assets Directory Snapshots > Python framework assets > python/python/a2
1889
1889
 
1890
1890
  exports[`Assets Directory Snapshots > Python framework assets > python/python/a2a/strands/capabilities/memory/session.py should match snapshot 1`] = `
1891
1891
  "import os
1892
+ import uuid
1892
1893
  from typing import Optional
1893
1894
 
1894
1895
  from bedrock_agentcore.memory.integrations.strands.config import AgentCoreMemoryConfig{{#if memoryProviders.[0].strategies.length}}, RetrievalConfig{{/if}}
@@ -1897,10 +1898,14 @@ from bedrock_agentcore.memory.integrations.strands.session_manager import AgentC
1897
1898
  MEMORY_ID = os.getenv("{{memoryProviders.[0].envVarName}}")
1898
1899
  REGION = os.getenv("AWS_REGION")
1899
1900
 
1900
- def get_memory_session_manager(session_id: str, actor_id: str) -> Optional[AgentCoreMemorySessionManager]:
1901
+ def get_memory_session_manager(session_id: Optional[str], actor_id: str) -> Optional[AgentCoreMemorySessionManager]:
1901
1902
  if not MEMORY_ID:
1902
1903
  return None
1903
1904
 
1905
+ # AgentCoreMemoryConfig rejects None; OAuth/CUSTOM_JWT callers can reach us
1906
+ # without a runtime session header, so synthesize one when absent.
1907
+ session_id = session_id or uuid.uuid4().hex
1908
+
1904
1909
  {{#if memoryProviders.[0].strategies.length}}
1905
1910
  retrieval_config = {
1906
1911
  {{#if (includes memoryProviders.[0].strategies "SEMANTIC")}}
@@ -2724,6 +2729,7 @@ exports[`Assets Directory Snapshots > Python framework assets > python/python/ag
2724
2729
 
2725
2730
  exports[`Assets Directory Snapshots > Python framework assets > python/python/agui/strands/capabilities/memory/session.py should match snapshot 1`] = `
2726
2731
  "import os
2732
+ import uuid
2727
2733
  from typing import Optional
2728
2734
 
2729
2735
  from bedrock_agentcore.memory.integrations.strands.config import AgentCoreMemoryConfig{{#if memoryProviders.[0].strategies.length}}, RetrievalConfig{{/if}}
@@ -2732,10 +2738,14 @@ from bedrock_agentcore.memory.integrations.strands.session_manager import AgentC
2732
2738
  MEMORY_ID = os.getenv("{{memoryProviders.[0].envVarName}}")
2733
2739
  REGION = os.getenv("AWS_REGION")
2734
2740
 
2735
- def get_memory_session_manager(session_id: str, actor_id: str) -> Optional[AgentCoreMemorySessionManager]:
2741
+ def get_memory_session_manager(session_id: Optional[str], actor_id: str) -> Optional[AgentCoreMemorySessionManager]:
2736
2742
  if not MEMORY_ID:
2737
2743
  return None
2738
2744
 
2745
+ # AgentCoreMemoryConfig rejects None; OAuth/CUSTOM_JWT callers can reach us
2746
+ # without a runtime session header, so synthesize one when absent.
2747
+ session_id = session_id or uuid.uuid4().hex
2748
+
2739
2749
  {{#if memoryProviders.[0].strategies.length}}
2740
2750
  retrieval_config = {
2741
2751
  {{#if (includes memoryProviders.[0].strategies "SEMANTIC")}}
@@ -4993,6 +5003,7 @@ exports[`Assets Directory Snapshots > Python framework assets > python/python/ht
4993
5003
 
4994
5004
  exports[`Assets Directory Snapshots > Python framework assets > python/python/http/strands/capabilities/memory/session.py should match snapshot 1`] = `
4995
5005
  "import os
5006
+ import uuid
4996
5007
  from typing import Optional
4997
5008
 
4998
5009
  from bedrock_agentcore.memory.integrations.strands.config import AgentCoreMemoryConfig{{#if memoryProviders.[0].strategies.length}}, RetrievalConfig{{/if}}
@@ -5001,10 +5012,14 @@ from bedrock_agentcore.memory.integrations.strands.session_manager import AgentC
5001
5012
  MEMORY_ID = os.getenv("{{memoryProviders.[0].envVarName}}")
5002
5013
  REGION = os.getenv("AWS_REGION")
5003
5014
 
5004
- def get_memory_session_manager(session_id: str, actor_id: str) -> Optional[AgentCoreMemorySessionManager]:
5015
+ def get_memory_session_manager(session_id: Optional[str], actor_id: str) -> Optional[AgentCoreMemorySessionManager]:
5005
5016
  if not MEMORY_ID:
5006
5017
  return None
5007
5018
 
5019
+ # AgentCoreMemoryConfig rejects None; OAuth/CUSTOM_JWT callers can reach us
5020
+ # without a runtime session header, so synthesize one when absent.
5021
+ session_id = session_id or uuid.uuid4().hex
5022
+
5008
5023
  {{#if memoryProviders.[0].strategies.length}}
5009
5024
  retrieval_config = {
5010
5025
  {{#if (includes memoryProviders.[0].strategies "SEMANTIC")}}
@@ -1,4 +1,5 @@
1
1
  import os
2
+ import uuid
2
3
  from typing import Optional
3
4
 
4
5
  from bedrock_agentcore.memory.integrations.strands.config import AgentCoreMemoryConfig{{#if memoryProviders.[0].strategies.length}}, RetrievalConfig{{/if}}
@@ -7,10 +8,14 @@ from bedrock_agentcore.memory.integrations.strands.session_manager import AgentC
7
8
  MEMORY_ID = os.getenv("{{memoryProviders.[0].envVarName}}")
8
9
  REGION = os.getenv("AWS_REGION")
9
10
 
10
- def get_memory_session_manager(session_id: str, actor_id: str) -> Optional[AgentCoreMemorySessionManager]:
11
+ def get_memory_session_manager(session_id: Optional[str], actor_id: str) -> Optional[AgentCoreMemorySessionManager]:
11
12
  if not MEMORY_ID:
12
13
  return None
13
14
 
15
+ # AgentCoreMemoryConfig rejects None; OAuth/CUSTOM_JWT callers can reach us
16
+ # without a runtime session header, so synthesize one when absent.
17
+ session_id = session_id or uuid.uuid4().hex
18
+
14
19
  {{#if memoryProviders.[0].strategies.length}}
15
20
  retrieval_config = {
16
21
  {{#if (includes memoryProviders.[0].strategies "SEMANTIC")}}
@@ -1,4 +1,5 @@
1
1
  import os
2
+ import uuid
2
3
  from typing import Optional
3
4
 
4
5
  from bedrock_agentcore.memory.integrations.strands.config import AgentCoreMemoryConfig{{#if memoryProviders.[0].strategies.length}}, RetrievalConfig{{/if}}
@@ -7,10 +8,14 @@ from bedrock_agentcore.memory.integrations.strands.session_manager import AgentC
7
8
  MEMORY_ID = os.getenv("{{memoryProviders.[0].envVarName}}")
8
9
  REGION = os.getenv("AWS_REGION")
9
10
 
10
- def get_memory_session_manager(session_id: str, actor_id: str) -> Optional[AgentCoreMemorySessionManager]:
11
+ def get_memory_session_manager(session_id: Optional[str], actor_id: str) -> Optional[AgentCoreMemorySessionManager]:
11
12
  if not MEMORY_ID:
12
13
  return None
13
14
 
15
+ # AgentCoreMemoryConfig rejects None; OAuth/CUSTOM_JWT callers can reach us
16
+ # without a runtime session header, so synthesize one when absent.
17
+ session_id = session_id or uuid.uuid4().hex
18
+
14
19
  {{#if memoryProviders.[0].strategies.length}}
15
20
  retrieval_config = {
16
21
  {{#if (includes memoryProviders.[0].strategies "SEMANTIC")}}
@@ -1,4 +1,5 @@
1
1
  import os
2
+ import uuid
2
3
  from typing import Optional
3
4
 
4
5
  from bedrock_agentcore.memory.integrations.strands.config import AgentCoreMemoryConfig{{#if memoryProviders.[0].strategies.length}}, RetrievalConfig{{/if}}
@@ -7,10 +8,14 @@ from bedrock_agentcore.memory.integrations.strands.session_manager import AgentC
7
8
  MEMORY_ID = os.getenv("{{memoryProviders.[0].envVarName}}")
8
9
  REGION = os.getenv("AWS_REGION")
9
10
 
10
- def get_memory_session_manager(session_id: str, actor_id: str) -> Optional[AgentCoreMemorySessionManager]:
11
+ def get_memory_session_manager(session_id: Optional[str], actor_id: str) -> Optional[AgentCoreMemorySessionManager]:
11
12
  if not MEMORY_ID:
12
13
  return None
13
14
 
15
+ # AgentCoreMemoryConfig rejects None; OAuth/CUSTOM_JWT callers can reach us
16
+ # without a runtime session header, so synthesize one when absent.
17
+ session_id = session_id or uuid.uuid4().hex
18
+
14
19
  {{#if memoryProviders.[0].strategies.length}}
15
20
  retrieval_config = {
16
21
  {{#if (includes memoryProviders.[0].strategies "SEMANTIC")}}