Skip to content

feat(core): implement context compression and project context loading#46

Merged
iohub merged 2 commits into
mainfrom
feat-openai-go
May 6, 2026
Merged

feat(core): implement context compression and project context loading#46
iohub merged 2 commits into
mainfrom
feat-openai-go

Conversation

@iohub
Copy link
Copy Markdown
Owner

@iohub iohub commented May 6, 2026

No description provided.

iohub added 2 commits May 6, 2026 19:51
- **Context Compression (`internal/compact`)**:
  - Implement `ContextCompressor` and `Engine` to manage context window overflow.
  - Integrate `tiktoken-go` for accurate token counting with LRU caching.
  - Add priority-based scoring (Role, Recency, Length) to identify low-value messages for removal.
  - Implement multi-level compression strategies:
    - L3: Early Discard (replace old messages with summary).
    - L2: Rule-based Truncation (truncate long tool outputs).
    - L1: Placeholder for LLM Summarization.
  - Support `conservative`, `balanced`, and `aggressive` strategies via `config.toml`.
- **Project Context Loading**:
  - Auto-load project knowledge files (`CODEACTOR.md`, `CLAUDE.md`, `AGENTS.md`) at startup.
  - Inject content into the Conductor's System Prompt to provide immediate architectural context.
- **Configuration**:
  - Add `context.compact` settings to config parsing (`config.go`) and global context (`global_context.go`).
  - Update `ConductorAgent` to trigger compression when token limits are exceeded.
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @iohub, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@iohub iohub merged commit 92aefbc into main May 6, 2026
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