Skip to content

Commit 0fa3217

Browse files
committed
fix: restore protocol-compatible session signatures with wrapper support
1 parent 69b01f8 commit 0fa3217

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

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
@@ -143,9 +143,8 @@ async def add_items(
143143
async def get_items(
144144
self,
145145
limit: int | None = None,
146+
wrapper: RunContextWrapper[Any] | str | None = None,
146147
branch_id: str | None = None,
147-
*,
148-
wrapper: RunContextWrapper[Any] | None = None,
149148
) -> list[TResponseInputItem]:
150149
"""Get items from current or specified branch.
151150
@@ -156,6 +155,10 @@ async def get_items(
156155
Returns:
157156
List of conversation items from the specified branch.
158157
"""
158+
if isinstance(wrapper, str) and branch_id is None:
159+
branch_id = wrapper
160+
wrapper = None
161+
159162
session_limit = resolve_session_limit(limit, self.session_settings)
160163

161164
if branch_id is None:

0 commit comments

Comments
 (0)