feat: add context configuration (compaction/compression/cache) support#1340
Open
dobesv wants to merge 4 commits intokagent-dev:mainfrom
Open
feat: add context configuration (compaction/compression/cache) support#1340dobesv wants to merge 4 commits intokagent-dev:mainfrom
dobesv wants to merge 4 commits intokagent-dev:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds context management configuration support to agents, enabling event compaction/compression and context caching. The implementation spans the entire stack from UI to Python runtime, with proper type definitions, validation, and test coverage.
Changes:
- Added context configuration types and UI components for managing event compaction and context caching
- Implemented Go CRD schema, translator logic, and deployment data merging for summarizer models
- Added Python ADK integration with proper config parsing and ADK native type construction
Reviewed changes
Copilot reviewed 20 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/types/index.ts | Added TypeScript interfaces for context configuration (compaction, cache, summarizer) |
| ui/src/components/ui/switch.tsx | New Switch component for toggle UI using Radix UI primitives |
| ui/src/components/create/ContextSection.tsx | Context management configuration form with compaction and cache settings |
| ui/src/components/AgentsProvider.tsx | Added context field to AgentFormData and validation errors |
| ui/src/app/agents/new/page.tsx | Integrated ContextSection component into agent creation page |
| ui/src/app/actions/agents.ts | Pass context config from form data to agent spec |
| ui/package.json, ui/package-lock.json | Added @radix-ui/react-switch dependency |
| python/uv.lock | Updated google-adk (>=1.25.0) and other dependencies (google-auth, google-genai, litellm, mcp, pydantic, httpx) |
| python/samples/adk/basic/pyproject.toml | Updated google-adk minimum version to 1.25.0 |
| python/packages/kagent-adk/tests/unittests/test_context_config.py | Comprehensive unit tests for context config parsing and ADK conversion |
| python/packages/kagent-adk/src/kagent/adk/types.py | Added context config Pydantic models and build_adk_context_configs function |
| python/packages/kagent-adk/src/kagent/adk/cli.py | Wired context config through KAgentApp initialization |
| python/packages/kagent-adk/src/kagent/adk/_a2a.py | Added context config parameters to KAgentApp and App initialization |
| python/packages/kagent-adk/pyproject.toml | Updated dependencies and removed memory extra (deferred to follow-up PR) |
| helm/kagent-crds/templates/kagent.dev_agents.yaml | Added context config schema to Agent CRD |
| go/pkg/adk/types.go | Added AgentContextConfig, AgentCompressionConfig, AgentCacheConfig types |
| go/internal/controller/translator/agent/adk_api_translator_test.go | Added tests for context config translation and deployment data merging |
| go/internal/controller/translator/agent/adk_api_translator.go | Implemented context config translation and mergeDeploymentData function |
| go/config/crd/bases/kagent.dev_agents.yaml | Generated CRD with context config schema |
| go/api/v1alpha2/zz_generated.deepcopy.go | Generated DeepCopy methods for new context config types |
| go/api/v1alpha2/agent_types.go | Added CRD types for context management (ContextConfig, ContextCompressionConfig, ContextCacheConfig, ContextSummarizerConfig) |
Files not reviewed (1)
- ui/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
EItanya
requested changes
Feb 23, 2026
Address PR review feedback: - Remove trailing blank line in adk_api_translator.go - Remove unused ADKSTSIntegration import from _a2a.py - Replace _build_context_kwargs dict/**kwargs pattern with _build_context_configs returning typed tuple + explicit named params - Sync uv.lock with pyproject.toml (memory extra removal) Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2708052 to
3cef4af
Compare
dobesv
commented
Feb 23, 2026
dobesv
commented
Feb 23, 2026
dobesv
commented
Feb 23, 2026
…hint - Use realistic placeholder values (150000 for token threshold, 3 for event retention size) - Add helper text clarifying token threshold requires event retention size Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds context management configuration to agents, including:
This is a subset of #1323, split per reviewer feedback to include only the context configuration changes (compaction/compression/cache), holding back the memory and resumability config changes for a follow-up PR.
Changes
Go (CRD + Controller)
ContextConfig,ContextCompressionConfig,ContextCacheConfig, andContextSummarizerConfigtypes tov1alpha2Agent CRDAgentContextConfig,AgentCompressionConfig, andAgentCacheConfigto the ADK config types (go/pkg/adk/types.go)adk_api_translator.goincluding summarizer model resolutionPython (ADK Runtime)
ContextCompressionSettings,ContextCacheSettings, andContextConfigPydantic modelsbuild_adk_context_configs()to convert config to ADK native typesevents_compaction_configandcontext_cache_configthroughKAgentApp→App→RunnerUI (Next.js)
ContextSectioncomponent with compaction and cache configuration formsContextConfigand related TypeScript typesDependencies
@radix-ui/react-switchfor toggle UI componentsgoogle-adkminimum version to>=1.25.0