diff --git a/.env.example b/.env.example index a616c2cab2..da143b2e13 100644 --- a/.env.example +++ b/.env.example @@ -600,7 +600,7 @@ GITHUB_OAUTH_CLIENT_ID=Iv1.b507a08c87ecfe98 # Used by: open-sse/executors/base.ts — buildHeaders() dynamic lookup. # Update these when providers release new CLI versions to avoid blocks. -CLAUDE_USER_AGENT="claude-cli/2.1.145 (external, cli)" +CLAUDE_USER_AGENT="claude-cli/2.1.146 (external, cli)" CODEX_USER_AGENT="codex-cli/0.132.0 (Windows 10.0.26200; x64)" GITHUB_USER_AGENT="GitHubCopilotChat/0.45.1" ANTIGRAVITY_USER_AGENT="antigravity/2.0.1 linux/arm64 google-api-nodejs-client/10.3.0" diff --git a/open-sse/config/anthropicHeaders.ts b/open-sse/config/anthropicHeaders.ts index 7ddc7a86a3..5f708a5a80 100644 --- a/open-sse/config/anthropicHeaders.ts +++ b/open-sse/config/anthropicHeaders.ts @@ -12,6 +12,9 @@ const ANTHROPIC_BETA_BASE = Object.freeze([ "fast-mode-2026-02-01", "redact-thinking-2026-02-12", "token-efficient-tools-2026-03-28", + "advisor-tool-2026-03-01", + "extended-cache-ttl-2025-04-11", + "cache-diagnosis-2026-04-07", ]); const CLAUDE_OAUTH_EXTRA_BETAS = Object.freeze(["fine-grained-tool-streaming-2025-05-14"]); @@ -26,7 +29,7 @@ export const ANTHROPIC_BETA_CLAUDE_OAUTH = [ ...ANTHROPIC_BETA_BASE.slice(3), ].join(","); -export const CLAUDE_CLI_VERSION = "2.1.137"; +export const CLAUDE_CLI_VERSION = "2.1.146"; export const CLAUDE_CLI_USER_AGENT = `claude-cli/${CLAUDE_CLI_VERSION} (external, cli)`; -export const CLAUDE_CLI_STAINLESS_PACKAGE_VERSION = "0.81.0"; +export const CLAUDE_CLI_STAINLESS_PACKAGE_VERSION = "0.94.0"; export const CLAUDE_CLI_STAINLESS_RUNTIME_VERSION = "v24.3.0"; diff --git a/open-sse/executors/claudeIdentity.ts b/open-sse/executors/claudeIdentity.ts index 4b4ea9bf5d..da79dfb37c 100644 --- a/open-sse/executors/claudeIdentity.ts +++ b/open-sse/executors/claudeIdentity.ts @@ -12,9 +12,9 @@ import { createHash, randomBytes, randomUUID } from "node:crypto"; // ---------- Versions ------------------------------------------------------ -export const CLAUDE_CODE_VERSION = "2.1.131"; +export const CLAUDE_CODE_VERSION = "2.1.146"; /** Bundled @anthropic-ai/sdk version for the pinned CLI release. */ -export const CLAUDE_CODE_STAINLESS_VERSION = "0.81.0"; +export const CLAUDE_CODE_STAINLESS_VERSION = "0.94.0"; // ---------- Stainless OS / Arch / Runtime -------------------------------- @@ -340,7 +340,7 @@ export function selectBetaFlags( if (hasStructuredOutput && !isFullAgent) flags.push("structured-outputs-2025-12-15"); // extended-cache-ttl is sent for all full-agent shapes (incl. Haiku); the // heavier advanced-tool-use / effort flags are Opus/Sonnet-only. - if (isFullAgent) flags.push("extended-cache-ttl-2025-04-11"); + if (isFullAgent) flags.push("extended-cache-ttl-2025-04-11", "cache-diagnosis-2026-04-07"); if (isHeavyAgent) { flags.push("advanced-tool-use-2025-11-20", "effort-2025-11-24"); } diff --git a/open-sse/handlers/chatCore.ts b/open-sse/handlers/chatCore.ts index da9dc7f94f..f63b474d81 100644 --- a/open-sse/handlers/chatCore.ts +++ b/open-sse/handlers/chatCore.ts @@ -1273,6 +1273,41 @@ function isCopilotClient( return false; } +export function extractSystemRoleMessages(payload: Record): void { + if (!Array.isArray(payload.messages)) return; + const messages = payload.messages as Array<{ role?: unknown; content?: unknown }>; + const systemMessages = messages.filter( + (m) => typeof m.role === "string" && m.role.toLowerCase() === "system" + ); + if (systemMessages.length === 0) return; + + const extraBlocks: Array> = []; + for (const sm of systemMessages) { + if (typeof sm.content === "string" && sm.content.length > 0) { + extraBlocks.push({ type: "text", text: sm.content }); + } else if (Array.isArray(sm.content)) { + for (const block of sm.content as Array>) { + if (block?.type === "text" && typeof block.text === "string" && block.text.length > 0) { + extraBlocks.push({ ...block }); + } + } + } + } + if (extraBlocks.length > 0) { + const existingSystem = payload.system; + if (typeof existingSystem === "string" && existingSystem.length > 0) { + payload.system = [{ type: "text", text: existingSystem }, ...extraBlocks]; + } else if (Array.isArray(existingSystem)) { + payload.system = [...(existingSystem as Array>), ...extraBlocks]; + } else { + payload.system = extraBlocks; + } + } + payload.messages = messages.filter( + (m) => typeof m.role !== "string" || m.role.toLowerCase() !== "system" + ); +} + export async function handleChatCore({ body, modelInfo, diff --git a/open-sse/services/ccBridgeTransforms.ts b/open-sse/services/ccBridgeTransforms.ts index 065b613a33..83c5138703 100644 --- a/open-sse/services/ccBridgeTransforms.ts +++ b/open-sse/services/ccBridgeTransforms.ts @@ -114,7 +114,7 @@ export const CCH_SALT = "59cf53e54c78"; /** Character positions sampled from the first user message text. */ export const CCH_POSITIONS = [4, 7, 20] as const; /** Default `cc_version=` value embedded in the billing header. */ -export const DEFAULT_CLAUDE_CODE_VERSION = "2.1.137"; +export const DEFAULT_CLAUDE_CODE_VERSION = "2.1.146"; /** Identity sentinel prepended for Claude Agent SDK callers. */ export const CLAUDE_AGENT_SDK_IDENTITY = "You are a Claude agent, built on Anthropic's Claude Agent SDK."; diff --git a/open-sse/services/claudeCodeCompatible.ts b/open-sse/services/claudeCodeCompatible.ts index a3ef3ac5e3..dad7da6f6f 100644 --- a/open-sse/services/claudeCodeCompatible.ts +++ b/open-sse/services/claudeCodeCompatible.ts @@ -39,9 +39,9 @@ export const CLAUDE_CODE_COMPATIBLE_ANTHROPIC_BETA = [ "interleaved-thinking-2025-05-14", "effort-2025-11-24", ].join(","); -export const CLAUDE_CODE_COMPATIBLE_VERSION = "2.1.137"; -export const CLAUDE_CODE_COMPATIBLE_USER_AGENT = "claude-cli/2.1.137 (external, sdk-cli)"; -export const CLAUDE_CODE_COMPATIBLE_STAINLESS_PACKAGE_VERSION = "0.81.0"; +export const CLAUDE_CODE_COMPATIBLE_VERSION = "2.1.146"; +export const CLAUDE_CODE_COMPATIBLE_USER_AGENT = "claude-cli/2.1.146 (external, sdk-cli)"; +export const CLAUDE_CODE_COMPATIBLE_STAINLESS_PACKAGE_VERSION = "0.94.0"; export const CLAUDE_CODE_COMPATIBLE_STAINLESS_RUNTIME_VERSION = "v24.3.0"; export const CONTEXT_1M_BETA_HEADER = "context-1m-2025-08-07"; const CLAUDE_CODE_COMPATIBLE_DEFAULT_SYSTEM_BLOCKS = [ diff --git a/open-sse/services/model.ts b/open-sse/services/model.ts index 8ded9dff24..e9a72fd665 100644 --- a/open-sse/services/model.ts +++ b/open-sse/services/model.ts @@ -34,7 +34,6 @@ for (const [id, alias] of Object.entries(PROVIDER_ID_TO_ALIAS)) { // opencode/ → opencode-zen (the main free/open tier; opencode-go is a separate paid tier) ALIAS_TO_PROVIDER_ID["opencode"] = "opencode-zen"; - // Manual aliases for external compatibility not covered by PROVIDER_ID_TO_ALIAS. // OpenCode's Zen provider now uses the "opencode" slug, but OmniRoute registers // it as "opencode-zen". This alias ensures `opencode/` resolves correctly. diff --git a/src/app/(dashboard)/dashboard/cli-tools/components/HermesAgentToolCard.tsx b/src/app/(dashboard)/dashboard/cli-tools/components/HermesAgentToolCard.tsx index 11114196c3..5731ac27fa 100644 --- a/src/app/(dashboard)/dashboard/cli-tools/components/HermesAgentToolCard.tsx +++ b/src/app/(dashboard)/dashboard/cli-tools/components/HermesAgentToolCard.tsx @@ -11,7 +11,11 @@ interface Role { const HERMES_ROLES: Role[] = [ { id: "default", label: "Default (main)", description: "Primary conversation model" }, - { id: "delegation", label: "Delegation (subagents)", description: "Orchestrator and sub-agent model" }, + { + id: "delegation", + label: "Delegation (subagents)", + description: "Orchestrator and sub-agent model", + }, { id: "vision", label: "Vision", description: "Image and screenshot understanding" }, { id: "compression", label: "Compression", description: "Prompt compression & summarization" }, { id: "web_extract", label: "Web Extract", description: "Web page content extraction" }, @@ -60,9 +64,11 @@ export default function HermesAgentToolCard({ useEffect(() => { if (isExpanded) { // Phase 3: Seed from detector snapshot (batchStatus) for instant UI - if (!seededFromBatchRef.current && - Object.keys(currentRoles).length === 0 && - batchStatus?.hermesAgentRoles) { + if ( + !seededFromBatchRef.current && + Object.keys(currentRoles).length === 0 && + batchStatus?.hermesAgentRoles + ) { const seeded: Record = {}; Object.entries(batchStatus.hermesAgentRoles).forEach(([role, info]: [string, any]) => { seeded[role] = { @@ -252,10 +258,7 @@ export default function HermesAgentToolCard({ return ( {/* Collapsed header — exact match to OpenClaw / Kilo / other Auto-Configured entries */} -
+
terminal @@ -274,8 +277,8 @@ export default function HermesAgentToolCard({ )} - {(Object.keys(currentRoles).length > 0 || - Object.keys(selections).length > 0 || + {(Object.keys(currentRoles).length > 0 || + Object.keys(selections).length > 0 || Object.keys(batchStatus?.hermesAgentRoles || {}).length > 0) && ( {configuredRolesCount}/{HERMES_ROLES.length} roles @@ -368,7 +371,9 @@ export default function HermesAgentToolCard({ {/* Left: role label + subtitle (now has room so long descriptions stay on one line) */}
{role.label}
-
{role.description}
+
+ {role.description} +
{/* Right cluster: model name + status badge + actions (pushed to the right) */} @@ -392,7 +397,8 @@ export default function HermesAgentToolCard({ : "bg-emerald-500/10 text-emerald-600" }`} > - {badge.label}{badge.pending ? " *" : ""} + {badge.label} + {badge.pending ? " *" : ""}
)} @@ -453,7 +459,11 @@ export default function HermesAgentToolCard({ variant="ghost" size="sm" onClick={handleTogglePreview} - disabled={isSaving || isLoading || (Object.keys(selections).length === 0 && Object.keys(currentRoles).length === 0)} + disabled={ + isSaving || + isLoading || + (Object.keys(selections).length === 0 && Object.keys(currentRoles).length === 0) + } loading={isPreviewLoading} > visibility @@ -462,7 +472,8 @@ export default function HermesAgentToolCard({ {Object.keys(selections).length > 0 && ( - {Object.keys(selections).length} role{Object.keys(selections).length === 1 ? "" : "s"} will be updated + {Object.keys(selections).length} role + {Object.keys(selections).length === 1 ? "" : "s"} will be updated )} @@ -510,4 +521,3 @@ export default function HermesAgentToolCard({ ); } - diff --git a/src/app/(dashboard)/dashboard/combos/page.tsx b/src/app/(dashboard)/dashboard/combos/page.tsx index 445366fb50..323e6b02e4 100644 --- a/src/app/(dashboard)/dashboard/combos/page.tsx +++ b/src/app/(dashboard)/dashboard/combos/page.tsx @@ -1740,12 +1740,24 @@ function ComboCard({ className="text-xs py-1 px-2 rounded border border-black/10 dark:border-white/10 bg-surface text-text-main focus:border-primary focus:outline-none transition-colors disabled:opacity-50 max-w-[130px] md:max-w-none" title={t("compressionOverride")} > - - - - - - + + + + + + )}