Skip to content

Commit 47da4ce

Browse files
zzstoatzzclaude
andauthored
fix: use async with for learning context manager (#1252)
* fix: use async with for learning context manager the learning SDK's context manager needs to be used with `async with` when wrapping async code. using sync `with` creates a sync client but the async interceptor expects an async client for memory operations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * chore: update uv.lock with agentic-learning dependencies 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 36da4c1 commit 47da4ce

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

examples/slackbot/src/slackbot/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ async def run_agent(
102102
max_tool_calls=settings.max_tool_calls_per_turn,
103103
):
104104
# wrap agent run with learning context for persistent memory
105-
with learning(agent=f"slackbot-{user_context['user_id']}"):
105+
async with learning(agent=f"slackbot-{user_context['user_id']}"):
106106
result = await create_agent(model=settings.model_name).run(
107107
user_prompt=cleaned_message,
108108
message_history=conversation,

uv.lock

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)