feat: add per-session LLM token budget with hard cap and soft warn#934
feat: add per-session LLM token budget with hard cap and soft warn#934harrykamboj1 wants to merge 1 commit into
Conversation
Signed-off-by: harrykamboj1 <singhharnoor116@gmail.com>
|
@harrykamboj1 is attempting to deploy a commit to the rohitg00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
mem:session-budget), default cap 100k viaAGENTMEMORY_SESSION_TOKEN_CAPResilientProvider: block when exhausted, record estimated tokens infinallyevent::mem::budget::soft-warned); hard cap (event::mem::budget::exhausted)GET /agentmemory/session/budget;agentmemory statusshows active / near-cap / exhaustedsession.tokens_usedon meteragentmemoryCloses #767
Test plan
npm test -- test/session-budget.test.ts(15 tests)npm test -- test/consistency.test.tsAGENTMEMORY_AUTO_COMPRESS=true, low cap, verify synthetic fallback + status lineSpec alignment / open items
inputTokens,callCount, timestamps)record/reapare implementation;getduplicates REST — can drop if preferredrecent-searches-sweep; no cron triggers in repo today__system__sentinelunknownvs__system____system__for clarity — rename if spec is strictcostEstimateat record for v1session.tokens_usedon meteragentmemory