diff --git a/open-sse/executors/base.ts b/open-sse/executors/base.ts index 721bfde73a..f0ecea2dc8 100644 --- a/open-sse/executors/base.ts +++ b/open-sse/executors/base.ts @@ -789,7 +789,14 @@ export class BaseExecutor { // sensitive words). It deliberately does NOT include // `inject_billing_header` — billing + sentinel are already // prepended above. Users can extend the pipeline via Settings UI. - applySystemTransformPipeline(PROVIDER_CLAUDE, tb); + { + const transformResult = applySystemTransformPipeline(PROVIDER_CLAUDE, tb); + if (transformResult.appliedOpKinds.length > 0) { + console.log( + `[SystemTransforms] claude-native: ${transformResult.appliedOpKinds.join(", ")}` + ); + } + } if (!tb.metadata || typeof tb.metadata !== "object") tb.metadata = {}; (tb.metadata as Record).user_id = buildUserIdJson({ diff --git a/open-sse/services/claudeCodeCompatible.ts b/open-sse/services/claudeCodeCompatible.ts index ae2d779973..f48912d1f9 100644 --- a/open-sse/services/claudeCodeCompatible.ts +++ b/open-sse/services/claudeCodeCompatible.ts @@ -339,10 +339,15 @@ export async function buildAndSignClaudeCodeRequest( // Routed via the generic per-provider DSL so the same pipeline shape covers // the CC bridge, the native `claude` path, and any other configured // provider. Idempotent on re-run. - applySystemTransformPipeline( - PROVIDER_CC_BRIDGE, - body as Parameters[1] - ); + { + const transformResult = applySystemTransformPipeline( + PROVIDER_CC_BRIDGE, + body as Parameters[1] + ); + if (transformResult.appliedOpKinds.length > 0) { + console.log(`[SystemTransforms] cc-bridge: ${transformResult.appliedOpKinds.join(", ")}`); + } + } // Step 6: Obfuscation (optional, per-provider setting) if (enableObfuscation) { diff --git a/open-sse/services/systemTransforms.ts b/open-sse/services/systemTransforms.ts index 50009b4273..4d8f265ef8 100644 --- a/open-sse/services/systemTransforms.ts +++ b/open-sse/services/systemTransforms.ts @@ -23,7 +23,7 @@ * * Reference: OmniRoute issue #2260 + comment 4459544580 (Open WebUI bypass). */ -import { obfuscateSensitiveWords } from "./claudeCodeObfuscation.ts"; + import { applyCcBridgeTransformPipeline, CLAUDE_AGENT_SDK_IDENTITY, @@ -213,18 +213,6 @@ interface RequestBody { // Op: obfuscate_words (the only op kind beyond the base set). // ──────────────────────────────────────────────────────────────────────────── -function setWordsForOp(words: string[]): void { - // Reuse the existing obfuscation engine — but it reads from its own module - // singleton. We swap the words for this op invocation; obfuscateSensitiveWords - // uses the module-level `sensitiveWords` array via setSensitiveWords. - // To keep this stateless across concurrent requests, we instead call - // obfuscateSensitiveWordsCustom (defined below) which takes the words list - // explicitly. - // — unused (intentional, see obfuscateWithList below). - void words; -} -void setWordsForOp; - function escapeRegex(str: string): string { return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); } @@ -298,10 +286,6 @@ function applyObfuscateWords(body: RequestBody, op: ObfuscateWordsOp): void { } } -// Silence unused-import warning on obfuscateSensitiveWords — re-export for -// callers that want the global-singleton variant. -export { obfuscateSensitiveWords }; - // ──────────────────────────────────────────────────────────────────────────── // Pipeline executor (delegates base ops to applyCcBridgeTransformPipeline). // ──────────────────────────────────────────────────────────────────────────── diff --git a/src/app/(dashboard)/dashboard/settings/components/RoutingTab.tsx b/src/app/(dashboard)/dashboard/settings/components/RoutingTab.tsx index fb75173834..8d2ba72701 100644 --- a/src/app/(dashboard)/dashboard/settings/components/RoutingTab.tsx +++ b/src/app/(dashboard)/dashboard/settings/components/RoutingTab.tsx @@ -708,7 +708,7 @@ export default function RoutingTab() { onChange={(e) => setJsonDrafts((prev) => ({ ...prev, [providerId]: e.target.value })) } - rows={Math.min(20, Math.max(8, draft.split("\n").length))} + rows={Math.min(40, Math.max(8, draft.split("\n").length))} disabled={loading} spellCheck={false} className="w-full rounded border border-border/50 bg-background/40 p-2 font-mono text-[11px] text-text resize-y"