Skip to content

feat: add automatic context compaction - #173

Merged
QueryPlanner merged 1 commit into
mainfrom
codex/auto-compaction
Aug 20, 2026
Merged

feat: add automatic context compaction#173
QueryPlanner merged 1 commit into
mainfrom
codex/auto-compaction

Conversation

@QueryPlanner

Copy link
Copy Markdown
Owner

What

Add native Google ADK token-based event compaction at 200,000 tokens so long conversations continue in the same session without requiring /reset.

Why

Prevent long-running conversations from growing beyond the model context window while preserving recent context and session continuity.

How

  • Configure EventsCompactionConfig with a 200,000-token threshold.
  • Retain the latest eight raw events and persist ADK compaction events.
  • Add integration and SQLite-backed compaction persistence coverage.
  • Document compaction behavior and the continued /reset escape hatch.

Tests

  • uv run ruff format --check
  • uv run ruff check --output-format=github
  • uv run mypy .
  • uv run pytest --cov=src --cov-report=xml --cov-report=term-missing (1612 passed, 1 skipped; 100% coverage)
  • uv run --no-sync mkdocs build --strict
  • bash -n setup.sh entrypoint.sh
  • Docker Compose production and development configuration checks
  • Docker image build, production smoke test, and OTLP validation; Docker daemon was unavailable locally

Related Issues

  • None.

Breaking Changes

None.

- Configure ADK token-threshold event compaction at 200000 tokens
- Verify session-preserving SQLite compaction persistence
- Document retained event context and reset behavior
@QueryPlanner
QueryPlanner marked this pull request as ready for review August 20, 2026 15:11
@QueryPlanner
QueryPlanner merged commit 80407ed into main Aug 20, 2026
3 checks passed
@QueryPlanner
QueryPlanner deleted the codex/auto-compaction branch August 20, 2026 15:11
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.

1 participant