[PR #8138] fix: add metadata.user_id to Anthropic API requests #12633

Closed
opened 2026-02-16 18:17:31 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8138

State: closed
Merged: No


Summary

  • Add metadata.user_id field to Anthropic API requests to enable proper caching
  • The user_id format: user_{projectId}_account__session_{sessionId}

Changes

  • provider.ts: Add custom fetch to inject metadata into request body
  • llm.ts: Add x-opencode-session header (removed before sending to API)
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8138 **State:** closed **Merged:** No --- ## Summary - Add metadata.user_id field to Anthropic API requests to enable proper caching - The user_id format: `user_{projectId}_account__session_{sessionId}` ## Changes - `provider.ts`: Add custom fetch to inject metadata into request body - `llm.ts`: Add x-opencode-session header (removed before sending to API)
yindo added the pull-request label 2026-02-16 18:17:31 -05:00
yindo closed this issue 2026-02-16 18:17:32 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12633