claude-connector: Messages API backend for API-key auth (tools, thinking, caching) #4

Merged
eureka merged 7 commits from hands/connector-messages-backend into main 2026-11-29 20:25:20 +00:00
Owner

A connector whose document says auth is an API key now answers with MessagesBackend: one non-streaming POST /v1/messages per call (anthropic-version 2026-10-21, ureq + rustls). The CLI keeps only the subscription token; ClaudeCodeConfig.auth, the API-key descriptor variable and its tests are deleted.

  • Tools, tool_use/tool_result, thinking blocks (replayed byte-content-identical as reasoning state, provider tag anthropic-messages), cache_control 5m/1h and cache read/write usage map natively; the contract's shapes are unchanged.
  • The key is read from the systemd credential at each call and travels only as the x-api-key header.
  • Deviations from cut spec r1, forced by the current API (sonnet-5-5 and opus-5-5 400 on forced tool_choice and on thinking budgets): Required is auto plus a system sentence; an output schema is output_config.format json_schema rather than a forced answer tool; reasoning effort is adaptive thinking plus output_config.effort.
  • Verified on Yggdrasil: cargo test --locked -p claude-connector (163 lib + integration tests green), cargo clippy --locked --all-targets -- -D warnings clean. No real API call was made.

Not merged; for review.

A connector whose document says `auth` is an API key now answers with `MessagesBackend`: one non-streaming `POST /v1/messages` per call (anthropic-version 2026-10-21, ureq + rustls). The CLI keeps only the subscription token; `ClaudeCodeConfig.auth`, the API-key descriptor variable and its tests are deleted. - Tools, tool_use/tool_result, thinking blocks (replayed byte-content-identical as reasoning state, provider tag `anthropic-messages`), `cache_control` 5m/1h and cache read/write usage map natively; the contract's shapes are unchanged. - The key is read from the systemd credential at each call and travels only as the `x-api-key` header. - Deviations from cut spec r1, forced by the current API (sonnet-5-5 and opus-5-5 400 on forced tool_choice and on thinking budgets): `Required` is `auto` plus a system sentence; an output schema is `output_config.format` json_schema rather than a forced `answer` tool; reasoning effort is adaptive thinking plus `output_config.effort`. - Verified on Yggdrasil: `cargo test --locked -p claude-connector` (163 lib + integration tests green), `cargo clippy --locked --all-targets -- -D warnings` clean. No real API call was made. Not merged; for review.
A connector whose document says auth is an API key now answers with one
Messages API request per call: tools, tool_use and tool_result, thinking
blocks replayed unchanged, cache breakpoints (5m or 1h) and cache usage map
natively. The CLI keeps only the subscription token: ClaudeCodeConfig.auth,
the API-key descriptor variable and its tests are deleted. Reasoning state of
this backend is tagged anthropic-messages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eureka merged commit edf2f8e03c into main 2026-11-29 20:25:20 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/ModelConnector!4
No description provided.