Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

chore: apply review suggestions and missing layers

diegosouzapwa430381434b0
diff --cc open-sse/executors/base.ts
index 00576b774c,1f5f8007b4..39a6fabb69
--- a/open-sse/executors/base.ts
+++ b/open-sse/executors/base.ts
@@@ -504,99 -528,160 +528,151 @@@ export class BaseExecutor
remapToolNamesInRequest(tb);
obfuscateInBody(tb);
- const ccVersion = "2.1.121";
- // Fix #1638: Use a stable fingerprint instead of message-derived one.
- // The original computeFingerprint() hashed first-user-message chars, which
- // changes every conversation turn. This mutated the system[] prefix on each
- // request, invalidating Anthropic's prompt-cache prefix and forcing ~100%
- // cache_create (vs 96% cache_read with a stable prefix). Using a per-day
- // hash keeps the billing header format while preserving cache affinity.
- const dayStamp = new Date().toISOString().slice(0, 10); // YYYY-MM-DD
- const fp = createHash("sha256")
- .update(`${dayStamp}${ccVersion}`)
- .digest("hex")
- .slice(0, 3);
- const billingLine = `x-anthropic-billing-header: cc_version=${ccVersion}.${fp}; cc_entrypoint=cli; cch=00000;`;
-
- if (Array.isArray(tb.system)) {
- const sysBlocks = tb.system as Array<Record<string, unknown>>;
- // Fix #1712: Remove any existing billing headers from the client
- // to prevent stacking that breaks Anthropic prompt cache prefix matching.
- for (let i = sysBlocks.length - 1; i >= 0; i--) {
- const block = sysBlocks[i];
- if (
- block &&
- typeof block.text === "string" &&
- block.text.startsWith("x-anthropic-billing-header:")
- ) {
- sysBlocks.splice(i, 1);
- }
- }
- const firstSystemCacheControl =
- sysBlocks[0] &&
- typeof sysBlocks[0] === "object" &&
- !Array.isArray(sysBlocks[0]) &&
- sysBlocks[0].cache_control
- ? sysBlocks[0].cache_control
- : undefined;
- const billingBlock: Record<string, unknown> = { type: "text", text: billingLine };
- if (firstSystemCacheControl) {
- billingBlock.cache_control = firstSystemCacheControl;
+ // Real CLI never sets cache_control on tools.
+ if (Array.isArray(tb.tools)) {
+ for (const t of tb.tools as Array<Record<string, unknown>>) {
+ delete t.cache_control;
}
- sysBlocks.unshift(billingBlock);
- } else if (typeof tb.system === "string") {
- tb.system = [
- { type: "text", text: billingLine },
- { type: "text", text: tb.system },
- ];
- } else {
- tb.system = [{ type: "text", text: billingLine }];
}
- if (!tb.metadata || typeof tb.metadata !== "object") {
- tb.metadata = {
- user_id: JSON.stringify({
- device_id: createHash("sha256").update("omniroute").digest("hex").slice(0, 24),
- account_uuid: "",
- session_id: randomUUID(),
- }),
- };
+ // Per-request behavior overrides via custom client headers.
+ // x-omniroute-effort: low | medium | high | xhigh | off
+ // x-omniroute-thinking: adaptive | off
+ // A header value applies only when the corresponding body field is
+ // not already set; "off" force-strips the field.
+ const headerEffort = (
- clientHeaders?.["x-omniroute-effort"] ??
- clientHeaders?.["X-OmniRoute-Effort"]
++ clientHeaders?.["x-omniroute-effort"] ?? clientHeaders?.["X-OmniRoute-Effort"]
+ )
+ ?.trim()
+ .toLowerCase();
+ const headerThinking = (
- clientHeaders?.["x-omniroute-thinking"] ??
- clientHeaders?.["X-OmniRoute-Thinking"]
++ clientHeaders?.["x-omniroute-thinking"] ?? clientHeaders?.["X-OmniRoute-Thinking"]
+ )
+ ?.trim()
+ .toLowerCase();
+ let appliedEffort: string | null = null;
+ let appliedThinking: string | null = null;
+
+ if (headerEffort === "off") {
+ if (tb.output_config && typeof tb.output_config === "object") {
+ delete (tb.output_config as Record<string, unknown>).effort;
+ }
+ appliedEffort = "off";
- } else if (
- headerEffort &&
- ["low", "medium", "high", "xhigh"].includes(headerEffort)
- ) {
++ } else if (headerEffort && ["low", "medium", "high", "xhigh"].includes(headerEffort)) {
+ const oc =
+ tb.output_config && typeof tb.output_config === "object"
+ ? (tb.output_config as Record<string, unknown>)
+ : {};
+ if (oc.effort === undefined) {
+ oc.effort = headerEffort;
+ tb.output_config = oc;
+ appliedEffort = headerEffort;
+ }
}
- const supportsAdaptiveThinking = supportsXHighEffort("claude", model);
-
- // Fix #1761: Only inject adaptive thinking/high effort if the client didn't
- // explicitly set these fields. This allows users to opt-out by sending
- // `thinking: null` or `output_config: { effort: "low" }` to prevent forced
- // quota drain on Claude Max accounts.
- const originalBody = body as Record<string, unknown>;
- const clientExplicitThinking = originalBody?.thinking !== undefined;
- const clientExplicitEffort = originalBody?.output_config !== undefined;
-
- if (supportsAdaptiveThinking && !tb.thinking && !clientExplicitThinking) {
- tb.thinking = { type: "adaptive" };
+ if (headerThinking === "adaptive") {
+ if (tb.thinking === undefined) {
+ tb.thinking = { type: "adaptive" };
+ appliedThinking = "adaptive";
+ }
+ if (tb.context_management === undefined) {
+ tb.context_management = {
+ edits: [{ type: "clear_thinking_20251015", keep: "all" }],
+ };
+ }
+ } else if (headerThinking === "off") {
+ delete tb.thinking;
+ delete tb.context_management;
+ appliedThinking = "off";
}
- if (supportsAdaptiveThinking && !tb.context_management && !clientExplicitThinking) {
+ // Real CLI always pairs context_management with thinking. Mirror
+ // that invariant so long sessions don't accumulate thinking blocks
+ // toward the context cap.
+ if (tb.thinking && !tb.context_management) {
tb.context_management = {
edits: [{ type: "clear_thinking_20251015", keep: "all" }],
};
}
- if (supportsAdaptiveThinking && !tb.output_config && !clientExplicitEffort) {
- tb.output_config = { effort: "high" };
- const seed =
- activeCredentials?.accessToken || activeCredentials?.apiKey || "anon";
++ const seed = activeCredentials?.accessToken || activeCredentials?.apiKey || "anon";
+ const psd = activeCredentials?.providerSpecificData as
+ | Record<string, unknown>
+ | undefined;
+
+ let identitySource: "upstream-metadata" | "upstream-header" | "synthesized" =
+ "synthesized";
+ let sessionId: string;
+ let deviceId: string;
+ let accountUUID: string;
+
+ const upstreamUserId = parseUpstreamMetadataUserId(tb);
+ if (upstreamUserId) {
+ sessionId = upstreamUserId.session_id;
+ deviceId = upstreamUserId.device_id;
+ accountUUID = upstreamUserId.account_uuid;
+ identitySource = "upstream-metadata";
+ } else {
+ const headerSid = passthroughUpstreamSessionId(
+ clientHeaders as Record<string, string | undefined> | undefined
+ );
+ sessionId = headerSid ?? getSessionId(seed);
+ deviceId = resolveCliUserID(psd, seed);
+ accountUUID = resolveAccountUUID(psd, seed, activeCredentials?.accessToken);
+ identitySource = headerSid ? "upstream-header" : "synthesized";
}
+ // system[0] (billing) and system[1] (sentinel) must not carry
+ // cache_control — that belongs on upstream prompt blocks at [2..].
+ const dayStamp = new Date().toISOString().slice(0, 10);
+ const buildHash = buildHashFor(CLAUDE_CODE_VERSION, dayStamp);
+ const billingLine = `x-anthropic-billing-header: cc_version=${CLAUDE_CODE_VERSION}.${buildHash}; cc_entrypoint=cli; cch=00000;`;
+ const SENTINEL = "You are Claude Code, Anthropic's official CLI for Claude.";
+
+ const sysBlocks: Array<Record<string, unknown>> = Array.isArray(tb.system)
+ ? (tb.system as Array<Record<string, unknown>>)
+ : typeof tb.system === "string"
+ ? [{ type: "text", text: tb.system }]
+ : [];
+
+ // Strip any pre-existing billing/sentinel before re-prepending — keeps
+ // retries idempotent and avoids stacking that breaks prompt-cache prefix
+ // matching (see issue #1712).
+ for (let i = sysBlocks.length - 1; i >= 0; i--) {
+ const t = sysBlocks[i]?.text;
+ if (typeof t === "string" && t.startsWith("x-anthropic-billing-header:")) {
+ sysBlocks.splice(i, 1);
+ }
+ }
+ for (let i = sysBlocks.length - 1; i >= 0; i--) {
+ const t = sysBlocks[i]?.text;
+ if (typeof t === "string" && t.startsWith(SENTINEL)) {
+ sysBlocks.splice(i, 1);
+ }
+ }
- sysBlocks.unshift(
- { type: "text", text: billingLine },
- { type: "text", text: SENTINEL }
- );
++ sysBlocks.unshift({ type: "text", text: billingLine }, { type: "text", text: SENTINEL });
+ tb.system = sysBlocks;
+
+ if (!tb.metadata || typeof tb.metadata !== "object") tb.metadata = {};
+ (tb.metadata as Record<string, unknown>).user_id = buildUserIdJson({
+ deviceId,
+ accountUUID,
+ sessionId,
+ });
+
+ // Headers. Accept stays application/json even on streams (Stainless
+ // convention; SSE decoding is gated on body.stream). anthropic-beta
+ // is selected per request shape; the full set on a quota probe is
+ // itself a fingerprint.
const ccHeaders: Record<string, string> = {
+ Accept: "application/json",
"anthropic-version": "2023-06-01",
- "anthropic-beta":
- "claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,redact-thinking-2026-02-12,context-management-2025-06-27,prompt-caching-scope-2026-01-05,advisor-tool-2026-03-01,advanced-tool-use-2025-11-20,effort-2025-11-24",
+ "anthropic-beta": selectBetaFlags(tb),
"anthropic-dangerous-direct-browser-access": "true",
"x-app": "cli",
- "User-Agent": `claude-cli/${ccVersion} (external, cli)`,
- "X-Stainless-Package-Version": "0.81.0",
+ "User-Agent": `claude-cli/${CLAUDE_CODE_VERSION} (external, cli)`,
+ "X-Stainless-Package-Version": CLAUDE_CODE_STAINLESS_VERSION,
"X-Stainless-Timeout": "600",
- "accept-language": "*",
"accept-encoding": "gzip, deflate, br, zstd",
connection: "keep-alive",
"x-client-request-id": randomUUID(),
diff --cc open-sse/executors/claudeIdentity.ts
index 0000000000,baf5a5efef..698664d929
mode 000000,100644..100644
--- a/open-sse/executors/claudeIdentity.ts
+++ b/open-sse/executors/claudeIdentity.ts
@@@ -1,0 -1,337 +1,341 @@@
+ /**
+ * Claude Code identity helpers used by the native `claude` provider when
+ * authenticating with an OAuth token. Anthropic's user:sessions:claude_code
+ * scope expects request shape that matches a real claude-cli session;
+ * everything in this module exists to produce that shape.
+ *
+ * Pinned to a captured claude-cli release. Bump in lockstep when a newer
+ * release is captured.
+ */
+
+ import { createHash, randomBytes, randomUUID } from "node:crypto";
+
+ // ---------- Versions ------------------------------------------------------
+
+ export const CLAUDE_CODE_VERSION = "2.1.131";
+ /** Bundled @anthropic-ai/sdk version for the pinned CLI release. */
+ export const CLAUDE_CODE_STAINLESS_VERSION = "0.81.0";
+
+ // ---------- Stainless OS / Arch / Runtime --------------------------------
+
+ export function stainlessOS(): string {
+ switch (process.platform) {
+ case "win32":
+ return "Windows";
+ case "darwin":
+ return "MacOS";
+ case "linux":
+ return "Linux";
+ case "freebsd":
+ return "FreeBSD";
+ default:
+ return "Unknown";
+ }
+ }
+
+ export function stainlessArch(): string {
+ switch (process.arch) {
+ case "x64":
+ return "x64";
+ case "arm64":
+ return "arm64";
+ case "ia32":
+ return "x32";
+ default:
+ return process.arch;
+ }
+ }
+
+ export function stainlessRuntimeVersion(): string {
+ return process.version;
+ }
+
+ // ---------- Bounded-map helper -------------------------------------------
+
+ const IDENTITY_CACHE_LIMIT = 10_000;
+ const BOOTSTRAP_FETCH_TIMEOUT_MS = 10_000;
+
+ /** Insert with FIFO eviction once a Map reaches `max`. JS Maps preserve insertion order. */
+ function setBounded<K, V>(m: Map<K, V>, key: K, value: V, max: number): void {
+ if (!m.has(key) && m.size >= max) {
+ const oldest = m.keys().next().value as K | undefined;
+ if (oldest !== undefined) m.delete(oldest);
+ }
+ m.set(key, value);
+ }
+
+ // ---------- Upstream session-id passthrough ------------------------------
+
+ const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
+
+ export function passthroughUpstreamSessionId(
+ clientHeaders: Record<string, string | undefined> | null | undefined
+ ): string | null {
+ if (!clientHeaders) return null;
+ const raw =
+ clientHeaders["x-claude-code-session-id"] ?? clientHeaders["X-Claude-Code-Session-Id"];
+ if (typeof raw !== "string") return null;
+ const v = raw.trim();
+ return UUID_RE.test(v) ? v : null;
+ }
+
+ // ---------- Session ID (per OAuth account, process lifetime) -------------
+
+ const sessionCache = new Map<string, string>();
+
+ /** Same value MUST be emitted as both X-Claude-Code-Session-Id and metadata.user_id.session_id. */
+ export function getSessionId(seed: string): string {
+ let id = sessionCache.get(seed);
+ if (id) return id;
+ id = randomUUID();
+ setBounded(sessionCache, seed, id, IDENTITY_CACHE_LIMIT);
+ return id;
+ }
+
+ // ---------- Device ID (cliUserID) ----------------------------------------
+
+ /** Real CLI uses crypto.randomBytes(32).toString("hex"), persisted to ~/.claude.json. */
+ export function generateCliUserID(): string {
+ return randomBytes(32).toString("hex");
+ }
+
+ const lazyCliUserIDCache = new Map<string, string>();
+
+ const HEX64_RE = /^[a-f0-9]{64}$/i;
+
+ /**
+ * Resolve the cliUserID for an account, in priority order:
+ * 1. providerSpecificData.cliUserID — persisted at OAuth provisioning.
+ * 2. providerSpecificData.userID — alt key (matches real CLI's own).
+ * 3. lazy-random — fresh randomBytes(32), cached for the process lifetime.
+ *
+ * Never deterministic from the access token.
+ */
+ export function resolveCliUserID(
+ providerSpecificData: Record<string, unknown> | undefined,
+ seed: string
+ ): string {
+ const cli = providerSpecificData?.cliUserID;
+ if (typeof cli === "string" && HEX64_RE.test(cli)) return cli;
+ const alt = providerSpecificData?.userID;
+ if (typeof alt === "string" && HEX64_RE.test(alt)) return alt;
+ let cached = lazyCliUserIDCache.get(seed);
+ if (cached) return cached;
+ cached = generateCliUserID();
+ setBounded(lazyCliUserIDCache, seed, cached, IDENTITY_CACHE_LIMIT);
+ return cached;
+ }
+
+ // ---------- Account UUID -------------------------------------------------
+
+ const ACCOUNT_FETCH_RETRY_MS = 5 * 60 * 1000;
+ const accountUuidCache = new Map<string, { uuid: string | null; fetchedAt: number }>();
+ const inflightFetches = new Set<string>();
+
+ async function backgroundFetchAccountUUID(accessToken: string, seed: string): Promise<void> {
+ if (inflightFetches.has(seed)) return;
+ const cached = accountUuidCache.get(seed);
+ if (cached?.uuid) return;
+ if (cached && Date.now() - cached.fetchedAt < ACCOUNT_FETCH_RETRY_MS) return;
+ inflightFetches.add(seed);
+ const ctrl = new AbortController();
+ const timer = setTimeout(() => ctrl.abort(), BOOTSTRAP_FETCH_TIMEOUT_MS);
+ try {
+ const res = await fetch("https://api.anthropic.com/api/claude_cli/bootstrap", {
+ method: "GET",
+ headers: {
+ Authorization: `Bearer ${accessToken}`,
+ Accept: "application/json",
+ "User-Agent": `claude-cli/${CLAUDE_CODE_VERSION} (external, cli)`,
+ "anthropic-beta": "oauth-2025-04-20",
+ },
+ signal: ctrl.signal,
+ });
+ const data: any = res.ok ? await res.json().catch(() => null) : null;
+ const uuid: string | null = data?.oauth_account?.account_uuid || null;
+ setBounded(accountUuidCache, seed, { uuid, fetchedAt: Date.now() }, IDENTITY_CACHE_LIMIT);
+ } catch {
+ setBounded(accountUuidCache, seed, { uuid: null, fetchedAt: Date.now() }, IDENTITY_CACHE_LIMIT);
+ } finally {
+ clearTimeout(timer);
+ inflightFetches.delete(seed);
+ }
+ }
+
+ /** Format-correct UUIDv4 from a 64-hex hash (deterministic fallback shape). */
+ export function uuidV4FromHash(hex64: string): string {
+ return [
+ hex64.slice(0, 8),
+ hex64.slice(8, 12),
+ "4" + hex64.slice(13, 16),
+ ((parseInt(hex64.charAt(16), 16) & 0x3) | 0x8).toString(16) + hex64.slice(17, 20),
+ hex64.slice(20, 32),
+ ].join("-");
+ }
+
+ /**
+ * Resolve account_uuid in priority order:
+ * 1. providerSpecificData.accountUUID / account_uuid (real, from bootstrap).
+ * 2. in-memory cache from a background bootstrap fetch.
+ * 3. deterministic UUIDv4 derived from the access token (shape-correct fallback).
+ *
+ * Triggers a background bootstrap fetch when no real UUID is known yet.
+ */
+ export function resolveAccountUUID(
+ providerSpecificData: Record<string, unknown> | undefined,
+ seed: string,
+ accessToken?: string
+ ): string {
+ const camel = providerSpecificData?.accountUUID;
+ if (typeof camel === "string" && camel.length >= 32) return camel;
+ const snake = providerSpecificData?.account_uuid;
+ if (typeof snake === "string" && snake.length >= 32) return snake;
+
+ const cached = accountUuidCache.get(seed);
+ if (cached?.uuid) return cached.uuid;
+
+ if (accessToken) void backgroundFetchAccountUUID(accessToken, seed);
+
- return uuidV4FromHash(createHash("sha256").update("account:" + seed).digest("hex"));
++ return uuidV4FromHash(
++ createHash("sha256")
++ .update("account:" + seed)
++ .digest("hex")
++ );
+ }
+
+ // ---------- metadata.user_id (the JSON-stringified blob) -----------------
+
+ /** Real CLI emits this exact key order: device_id, account_uuid, session_id. */
+ export function buildUserIdJson(opts: {
+ deviceId: string;
+ accountUUID: string;
+ sessionId: string;
+ }): string {
+ return JSON.stringify({
+ device_id: opts.deviceId,
+ account_uuid: opts.accountUUID,
+ session_id: opts.sessionId,
+ });
+ }
+
+ export function parseUpstreamMetadataUserId(
+ body: Record<string, unknown> | null | undefined
+ ): { device_id: string; account_uuid: string; session_id: string } | null {
+ if (!body) return null;
+ const md = body.metadata as Record<string, unknown> | undefined;
+ const raw = md?.user_id;
+ if (typeof raw !== "string" || raw.length === 0) return null;
+ let parsed: any;
+ try {
+ parsed = JSON.parse(raw);
+ } catch {
+ return null;
+ }
+ if (!parsed || typeof parsed !== "object") return null;
+ const { device_id, account_uuid, session_id } = parsed;
+ if (
+ typeof device_id !== "string" ||
+ !HEX64_RE.test(device_id) ||
+ typeof account_uuid !== "string" ||
+ !UUID_RE.test(account_uuid) ||
+ typeof session_id !== "string" ||
+ !UUID_RE.test(session_id)
+ ) {
+ return null;
+ }
+ return { device_id, account_uuid, session_id };
+ }
+
+ // ---------- anthropic-beta selector --------------------------------------
+
+ /**
+ * Pick the anthropic-beta flag set that matches the request shape. Real CLI
+ * uses three patterns: minimal probe, structured-output, and full agent.
+ * Sending the full set on every shape is itself a fingerprint.
+ */
+ export function selectBetaFlags(body: Record<string, unknown> | null | undefined): string {
+ const b = body || {};
+ const hasSystem =
+ !!b.system &&
+ (typeof b.system === "string" || (Array.isArray(b.system) && b.system.length > 0));
+ const tools = b.tools as unknown[] | undefined;
+ const hasTools = Array.isArray(tools) && tools.length > 0;
+ const outputCfg = b.output_config as Record<string, unknown> | undefined;
+ const hasStructuredOutput =
+ !!(outputCfg && (outputCfg.format as { type?: string } | undefined)?.type === "json_schema") ||
+ !!(b.response_format as { type?: string } | undefined)?.type;
+ const isFullAgent = hasTools && hasSystem;
+
+ const flags: string[] = [];
+ if (isFullAgent) flags.push("claude-code-20250219");
+ flags.push("oauth-2025-04-20");
+ if (isFullAgent) flags.push("context-1m-2025-08-07");
+ flags.push(
+ "interleaved-thinking-2025-05-14",
+ "redact-thinking-2026-02-12",
+ "context-management-2025-06-27",
+ "prompt-caching-scope-2026-01-05"
+ );
+ if (hasStructuredOutput || isFullAgent) flags.push("advisor-tool-2026-03-01");
+ if (hasStructuredOutput && !isFullAgent) flags.push("structured-outputs-2025-12-15");
+ if (isFullAgent) {
+ flags.push(
+ "advanced-tool-use-2025-11-20",
+ "effort-2025-11-24",
+ "extended-cache-ttl-2025-04-11"
+ );
+ }
+ return flags.join(",");
+ }
+
+ // ---------- billing-header build hash ------------------------------------
+
+ /**
+ * 3-char build hash for the billing header `cc_version=X.Y.Z.HASH`. Stable
+ * per (day, version) — Anthropic does not appear to validate the value, so
+ * we keep prompt-cache prefix stable within a day for a given version
+ * without coupling to any captured value.
+ */
+ export function buildHashFor(version: string, dayStamp: string): string {
+ return createHash("sha256").update(`${dayStamp}${version}`).digest("hex").slice(0, 3);
+ }
+
+ // ---------- Tool-name normalisation --------------------------------------
+
+ const TOOL_PREFIX = "proxy_";
+
+ /** Strip OmniRoute's `proxy_` tool-name prefix; real CLI never sends it. */
+ export function stripProxyToolPrefix(body: Record<string, unknown>): void {
+ const stripName = (n: unknown): string | undefined => {
+ if (typeof n !== "string") return undefined;
+ return n.startsWith(TOOL_PREFIX) ? n.slice(TOOL_PREFIX.length) : n;
+ };
+
+ const tools = body.tools as Array<Record<string, unknown>> | undefined;
+ if (Array.isArray(tools)) {
+ for (const t of tools) {
+ const stripped = stripName(t.name);
+ if (stripped !== undefined) t.name = stripped;
+ }
+ }
+
+ const tc = body.tool_choice as Record<string, unknown> | undefined;
+ if (tc && typeof tc.name === "string") {
+ const stripped = stripName(tc.name);
+ if (stripped !== undefined) tc.name = stripped;
+ }
+
+ const messages = body.messages as Array<Record<string, unknown>> | undefined;
+ if (Array.isArray(messages)) {
+ for (const m of messages) {
+ const content = m.content;
+ if (!Array.isArray(content)) continue;
+ for (const block of content as Array<Record<string, unknown>>) {
+ if (block?.type === "tool_use") {
+ const stripped = stripName(block.name);
+ if (stripped !== undefined) block.name = stripped;
+ }
+ }
+ }
+ }
+ }
diff --cc src/shared/components/ProviderIcon.tsx
index 29dc044a3c,05244283b7..ce86ab61be
--- a/src/shared/components/ProviderIcon.tsx
+++ b/src/shared/components/ProviderIcon.tsx
@@@ -57,58 -45,18 +45,19 @@@ const KNOWN_PNGS = new Set(
"copilot",
"cursor",
"deepgram",
- "deepseek",
- "droid",
- "exa-search",
- "fireworks",
- "gemini-cli",
- "gemini",
- "github",
- "glm",
- "glmt",
- "groq",
"ironclaw",
+ "kie",
- "kilo-gateway",
- "kilocode",
- "kimi-coding-apikey",
- "kimi-coding",
- "kimi",
- "kiro",
- "longcat",
- "minimax-cn",
- "minimax",
- "mistral",
"nanobot",
- "nebius",
- "nvidia",
"oai-cc",
"oai-r",
- "ollama-cloud",
- "openai",
"openclaw",
- "openrouter",
- "perplexity-search",
- "perplexity",
- "pollinations",
- "qwen",
- "roo",
"serper-search",
"serper",
- "siliconflow",
- "tavily-search",
- "tavily",
- "together",
- "xai",
"zeroclaw",
- "aws-polly",
"blackbox-web",
"cliproxyapi",
- "databricks",
"empower",
"gigachat",
- "gitlab-duo",
- "gitlab",
"heroku",
"linkup-search",
"llamagate",