Overview
Update ClaudeLanguageModelServer to properly passthrough the Anthropic Messages API while maintaining billing behavior for user-generated messages and proper user agent handling.
Current State
The ClaudeLanguageModelServer in src/extension/agents/claude/node/claudeLanguageModelServer.ts already implements an HTTP server that provides an Anthropic Messages API compatible endpoint. It acts as a proxy to the underlying model endpoint.
Tasks
Key Considerations
- The proxy currently validates auth using a nonce (
x-api-key)
- Requests are handled via
handleAuthedMessagesRequest
- Need to preserve telemetry data flow through
IChatMLFetcher and IEndpointProvider
Related Files
src/extension/agents/claude/node/claudeLanguageModelServer.ts
src/platform/endpoint/node/messagesApi.ts
src/platform/networking/common/networking.ts
Dependencies
- Should be done after SDK update (#TBD)
Overview
Update
ClaudeLanguageModelServerto properly passthrough the Anthropic Messages API while maintaining billing behavior for user-generated messages and proper user agent handling.Current State
The
ClaudeLanguageModelServerinsrc/extension/agents/claude/node/claudeLanguageModelServer.tsalready implements an HTTP server that provides an Anthropic Messages API compatible endpoint. It acts as a proxy to the underlying model endpoint.Tasks
ClaudeLanguageModelServerstream: true) works correctlyKey Considerations
x-api-key)handleAuthedMessagesRequestIChatMLFetcherandIEndpointProviderRelated Files
src/extension/agents/claude/node/claudeLanguageModelServer.tssrc/platform/endpoint/node/messagesApi.tssrc/platform/networking/common/networking.tsDependencies