-
Notifications
You must be signed in to change notification settings - Fork 93
Fix unbounded query context growth in chat sessions #453
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingchatChat SDK changesChat SDK changesdomain:surfacesAgent UI, Telegram, WhatsApp, Slack/Discord, mobileAgent UI, Telegram, WhatsApp, Slack/Discord, mobilep1medium prioritymedium priorityperformancePerformance-critical changesPerformance-critical changesragRAG system changesRAG system changestrack:consumer-appHermes-competitor consumer product — mobile-first, voice + messaging + memory + skillsHermes-competitor consumer product — mobile-first, voice + messaging + memory + skills
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingchatChat SDK changesChat SDK changesdomain:surfacesAgent UI, Telegram, WhatsApp, Slack/Discord, mobileAgent UI, Telegram, WhatsApp, Slack/Discord, mobilep1medium prioritymedium priorityperformancePerformance-critical changesPerformance-critical changesragRAG system changesRAG system changestrack:consumer-appHermes-competitor consumer product — mobile-first, voice + messaging + memory + skillsHermes-competitor consumer product — mobile-first, voice + messaging + memory + skills
Problem
`src/gaia/chat/ui/server.py:690-723` — chat history grows without checking total token count against the model's context window:
No truncation if history + RAG context + system prompt approaches model limit.
Impact
Proposed Fix
Files
src/gaia/chat/ui/server.py(lines 690-723, _get_chat_response)src/gaia/chat/sdk.py(conversation history management)Acceptance Criteria