fix(claude): remove global header cache, gate anthropic-beta by model
The global claudeHeaderCache singleton overlaid the last-seen Claude Code client's identity headers onto every subsequent request, leaking one client's headers (anthropic-beta, user-agent, x-stainless-*, etc.) onto another client/account sharing the same server. Removed the singleton and the claudeOverlay hook entirely, falling back to static per-provider headers. anthropic-beta is now computed per-request from the requested model, gating heavy-agent flags (advanced-tool-use, effort) to opus/sonnet only.
This commit is contained in:
@@ -7,7 +7,6 @@ import {
|
||||
extractApiKey,
|
||||
isValidApiKey,
|
||||
} from "../services/auth.js";
|
||||
import { cacheClaudeHeaders } from "open-sse/utils/claudeHeaderCache.js";
|
||||
import { getSettings } from "@/lib/localDb";
|
||||
import { getModelInfo, getComboModels } from "../services/model.js";
|
||||
import { handleChatCore } from "open-sse/handlers/chatCore.js";
|
||||
@@ -46,8 +45,6 @@ export async function handleChat(request, clientRawRequest = null) {
|
||||
headers: Object.fromEntries(request.headers.entries())
|
||||
};
|
||||
}
|
||||
cacheClaudeHeaders(clientRawRequest.headers);
|
||||
|
||||
const modelStr = body.model;
|
||||
|
||||
// Request summary is emitted as the unified "▶" line in chatCore (has fmt/thinking/account)
|
||||
|
||||
Reference in New Issue
Block a user