mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-04-02 17:32:39 +00:00
fix: clear heartbeat session to prevent token overflow
(cherry picked from commit 5c871d75d5b1aac09a8df31e6d1e04ee3d9b0d2c)
This commit is contained in:
parent
84a7f8af73
commit
ba0a3d14d9
@ -619,6 +619,12 @@ def gateway(
|
||||
chat_id=chat_id,
|
||||
on_progress=_silent,
|
||||
)
|
||||
|
||||
# Clear the heartbeat session to prevent token overflow from accumulated tasks
|
||||
session = agent.sessions.get_or_create("heartbeat")
|
||||
session.clear()
|
||||
agent.sessions.save(session)
|
||||
|
||||
return resp.content if resp else ""
|
||||
|
||||
async def on_heartbeat_notify(response: str) -> None:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user