Skip to content

feat: add session token budgets#1028

Merged
wbugitlab1 merged 6 commits into
mainfrom
issue/311-session-token-budget
Jun 20, 2026
Merged

feat: add session token budgets#1028
wbugitlab1 merged 6 commits into
mainfrom
issue/311-session-token-budget

Conversation

@wbugitlab1

Copy link
Copy Markdown
Owner

Summary

  • Add per-session token budget state, init/record/reap functions, AsyncLocalStorage session propagation, provider guards, and hard-cap fallback behavior for compression and summaries.
  • Expose budget status through health and agentmemory status, document AGENTMEMORY_SESSION_TOKEN_CAP, and regenerate the config skill reference.
  • Merge current origin/main and preserve its failure-audit/session-reaper changes alongside the session-budget feature.

Verification

  • corepack pnpm exec vitest run test/session-context.test.ts test/session-budget.test.ts test/telemetry-session-budget.test.ts test/resilient-provider.test.ts test/api-session-start.test.ts test/observe-implicit-session.test.ts test/summarize.test.ts test/compress-budget.test.ts test/cli-status-budget.test.ts
  • corepack pnpm run lint
  • corepack pnpm run build
  • corepack pnpm run skills:check
  • corepack pnpm test (post-merge: 216 files, 2950 tests)
  • semgrep scan --config p/default --error --metrics=off .
  • gitleaks protect --staged --redact

Closes #311.

Willi Budzinski added 6 commits June 20, 2026 04:00
…en-budget

# Conflicts:
#	plugin/skills/agentmemory-config/REFERENCE.md
#	src/functions/compress.ts
#	src/functions/consolidation-pipeline.ts
#	src/functions/summarize.ts
#	src/triggers/api.ts
#	test/summarize.test.ts
@wbugitlab1 wbugitlab1 merged commit ad167c7 into main Jun 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(budget): per-session token cap with soft warn + hard block

1 participant