Skip to content

Feat/context management#3049

Merged
olimorris merged 19 commits intomainfrom
feat/context-management
Apr 21, 2026
Merged

Feat/context management#3049
olimorris merged 19 commits intomainfrom
feat/context-management

Conversation

@olimorris
Copy link
Copy Markdown
Owner

@olimorris olimorris commented Apr 19, 2026

Description

This PR will add the ability for CodeCompanion to manage context when it approaches a token value or context window percentage. This should prevent chats from becoming unusable or context rot setting in.

TBU.

Summary of changes

  • Anthropic: The adapter has been overhauled to include much larger max_tokens parameters as well as conform to various changes that Anthropic brought in with the 4.6 models. Compaction has also been enabled.
  • OpenAI Responses: The adapter now fully supports compaction via their native server-side process.

AI Usage

Opus 4.6 to double check my implementation against documentation.

Related Issue(s)

Screenshots

Checklist

  • I've read the contributing guidelines and have adhered to them in this PR
  • I confirm that this PR has been majority created by me, and not AI (unless stated in the "AI Usage" section above)
  • I've run make all to ensure docs are generated, tests pass and StyLua has formatted the code
  • (optional) I've added test coverage for this fix/feature
  • (optional) I've updated the README and/or relevant docs pages

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 21, 2026

Deploying codecompanion with  Cloudflare Pages  Cloudflare Pages

Latest commit: fbc1fcf
Status: ✅  Deploy successful!
Preview URL: https://e39cf7e5.codecompanion.pages.dev
Branch Preview URL: https://feat-context-management.codecompanion.pages.dev

View logs

@olimorris olimorris marked this pull request as ready for review April 21, 2026 19:59
@olimorris olimorris merged commit cafa9e1 into main Apr 21, 2026
7 checks passed
@olimorris olimorris deleted the feat/context-management branch April 21, 2026 20:03
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