Skip to content

feat: Anthropic distill support (llm.api=anthropic-messages)#399

Open
Coke1120 wants to merge 3 commits intoCortexReach:masterfrom
Coke1120:feat/anthropic-distill
Open

feat: Anthropic distill support (llm.api=anthropic-messages)#399
Coke1120 wants to merge 3 commits intoCortexReach:masterfrom
Coke1120:feat/anthropic-distill

Conversation

@Coke1120
Copy link
Copy Markdown

Summary

  • Add createAnthropicApiKeyClient to src/llm-client.ts supporting Anthropic /v1/messages API via llm.api=anthropic-messages
  • Add llm.api and llm.anthropicVersion config fields to index.ts, cli.ts, and openclaw.plugin.json
  • Add examples/new-session-distill/ with a worker demonstrating Anthropic-based lesson extraction
  • Add test/llm-api-key-client.test.mjs and update plugin-manifest-regression to assert new schema fields
  • Document Anthropic config and Bitwarden secret refs in README.md

Test plan

  • node --test test/llm-api-key-client.test.mjs — verify Anthropic client key handling
  • node test/plugin-manifest-regression.mjs — verify manifest schema declares llm.api and llm.anthropicVersion
  • Smoke-test distill via examples/new-session-distill/ with a real session

Split from #349.

🤖 Generated with Claude Code

Add createAnthropicApiKeyClient to src/llm-client.ts supporting the
Anthropic /v1/messages API format via llm.api=anthropic-messages.
Add llm.api and llm.anthropicVersion config fields to index.ts, cli.ts,
and openclaw.plugin.json. Add examples/new-session-distill/ with a
worker demonstrating Anthropic-based lesson extraction. Add
test/llm-api-key-client.test.mjs and update plugin-manifest-regression
to assert the new schema fields.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Coke1120 and others added 2 commits March 29, 2026 22:24
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
With async register() now awaited, selfImprovement defaults to enabled
and registers command:new before the sessionMemory assertion runs.
Explicitly disable it in the base test config to isolate the assertion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@AliceLJY
Copy link
Copy Markdown
Collaborator

Anthropic client implementation looks good — endpoint normalization, content block parsing, and JSON repair all handled correctly.

This PR includes all changes from #398 (Bitwarden secret resolver) — stacked PRs. #398 needs to merge first, then this PR's diff will be just the Anthropic additions. Will review/approve once #398 lands.

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.

2 participants