Skip to content

Chat sends full session history every turn (unbounded prompt growth, cost + context overflow) #3430

Description

@Chris0Jeky

See coordinator findings C-ChatHistory. All three LLM call sites in ChatService (tool orchestrator L371, single-turn L518, streaming L941) map the ENTIRE session.Messages into the completion request with no TakeLast/window, and neither the orchestrator nor the provider truncates history (only tool results are capped via MaxToolResultBytes). Long sessions grow every prompt linearly: rising cost per turn until the provider rejects with context-length errors. Suggested: sliding window (e.g. last N messages or token budget) with system-prompt + latest user message always retained, as a setting next to MaxToolResultBytes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority IIIValuable but unscheduled: residuals, tech-debt, performance, depth work.bugSomething isn't working

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions