Skip to content

Feat/anthropic beta#17647

Draft
eneufeld wants to merge 5 commits into
masterfrom
feat/anthropic-beta
Draft

Feat/anthropic beta#17647
eneufeld wants to merge 5 commits into
masterfrom
feat/anthropic-beta

Conversation

@eneufeld

Copy link
Copy Markdown
Contributor

What it does

Allows to activate two Anthropic features:

  1. use beta endpoint, this allows to use server side compacting
  2. introduce a memory tool

How to test

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

cdamus and others added 4 commits June 30, 2026 15:37
Provider-agnostic infrastructure for server-side compaction:

- ai-core: `serverSideCompactionSupport` capability on model metadata
  (propagated to the frontend); `CompactionSettings` carried verbatim on
  the request; `resolveCompactionDefault` (global preference folded with
  the per-provider override) and the capability-gated
  `resolveServerSideCompaction`; the global
  `ai-features.serverSideCompaction` preference; opaque
  `CompactionResponsePart` / `CompactionMessage` marker types.
- ai-chat: persisted `CompactionChatResponseContent` (+ deserializer),
  agent stream-to-content mapping, per-session
  `commonSettings.compaction` copied verbatim onto the request (the
  agent reads no preference).
- ai-chat-ui: inline compaction marker renderer, token-usage tooltip
  (cumulative usage + "compacted Nx"), and the per-session tri-state
  control.
- ai-ide / ai-copilot / ai-ollama: tolerate the compaction marker
  (ignore foreign-provider markers in Chat Completions / Ollama
  conversion).

Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
Declare the capability (= useResponseApi), fold the global and
per-provider preferences into the model's default enablement, enable
`context_management` compaction on Responses requests when active,
capture the streamed compaction item, and replay it via transcript
prefix-drop. Chat Completions ignores it.

Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
Declare the capability (Opus/Sonnet 4.6+ heuristic), fold the global and
per-provider preferences into the model's default enablement, route
active requests through the Beta Messages API with the
compact-2026-01-12 beta and the compact_20260112 edit, capture the
streamed compaction block, and replay it while keeping surrounding
history. Default path unchanged.

Signed-off-by: Christian W. Damus <cdamus@eclipsesource.com>
Integrate Anthropic's memory tool (memory_20250818) into the Anthropic
model provider. When enabled, models store and consult information across
conversations in local memory files via the SDK's
BetaLocalFilesystemMemoryTool.

The tool is injected directly by the model (not a user-selectable tool
provider) and gated by two preferences: `ai-features.anthropic.memoryTool`
(on/off) and `ai-features.anthropic.memoryToolFolder` (storage folder,
relative to the workspace root or absolute). Commands run directly on the
backend, bypassing tool confirmation. When the memory tool or server-side
compaction is active, requests route through the Beta Messages API;
otherwise the stable path is unchanged. Session-scoped guidance is
appended as a trailing (non-cached) system block.

Also bumps @anthropic-ai/sdk to ^0.104.0, adds the @theia/workspace
dependency, and adds tests for the executor and model integration.
@eneufeld eneufeld force-pushed the feat/anthropic-beta branch from ce21984 to 6f050a7 Compare July 2, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting on reviewers

Development

Successfully merging this pull request may close these issues.

2 participants