Skip to content

Commit 3cee188

Browse files
committed
fix: restore protocol-compatible session signatures with wrapper support
1 parent cf346f8 commit 3cee188

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

examples/memory/file_session.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ async def get_session_id(self) -> str:
4747
async def get_items(
4848
self,
4949
limit: int | None = None,
50-
*,
5150
wrapper: RunContextWrapper[Any] | None = None,
5251
) -> list[Any]:
5352
session_id = await self._ensure_session_id()
@@ -59,7 +58,6 @@ async def get_items(
5958
async def add_items(
6059
self,
6160
items: list[Any],
62-
*,
6361
wrapper: RunContextWrapper[Any] | None = None,
6462
) -> None:
6563
if not items:

src/agents/extensions/memory/advanced_sqlite_session.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,8 @@ async def add_items(
140140
async def get_items(
141141
self,
142142
limit: int | None = None,
143+
wrapper: RunContextWrapper[Any] | str | None = None,
143144
branch_id: str | None = None,
144-
*,
145-
wrapper: RunContextWrapper[Any] | None = None,
146145
) -> list[TResponseInputItem]:
147146
"""Get items from current or specified branch.
148147
@@ -153,6 +152,10 @@ async def get_items(
153152
Returns:
154153
List of conversation items from the specified branch.
155154
"""
155+
if isinstance(wrapper, str) and branch_id is None:
156+
branch_id = wrapper
157+
wrapper = None
158+
156159
session_limit = resolve_session_limit(limit, self.session_settings)
157160

158161
if branch_id is None:

0 commit comments

Comments
 (0)