From 1a9d24be8b07f6ba894c1868f4d4aac22e736573 Mon Sep 17 00:00:00 2001 From: awork Date: Sun, 18 Oct 2026 00:48:45 +0800 Subject: [PATCH] refactor(#3603): lane-decisions reuses the shared RUN_CODE_TOOL_NAME for the PTC omnibus check --- src/compress-tool.ts | 2 +- src/server/lane-decisions.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compress-tool.ts b/src/compress-tool.ts index e679fdf047..007dd2625c 100644 --- a/src/compress-tool.ts +++ b/src/compress-tool.ts @@ -260,7 +260,7 @@ export const BILI_ACP_READONLY_TOOLS_RESPONSES = ACP_READONLY_TOOLS_RESPONSES.ma // reaches the harness at all (the proxy tool loop executes it // server-side), so the exempt note tells the model to ignore the harness's // only-run_code rule for exactly these tools. -const RUN_CODE_TOOL_NAME = "run_code"; +export const RUN_CODE_TOOL_NAME = "run_code"; /** Calling-convention note mode for one request (internal to this module — * inject.ts/plugin.ts pick the mode via ptcNoteMode()/the literal "binding"). */ diff --git a/src/server/lane-decisions.ts b/src/server/lane-decisions.ts index 6c921a0d7b..9d3bcf9ef1 100644 --- a/src/server/lane-decisions.ts +++ b/src/server/lane-decisions.ts @@ -25,6 +25,7 @@ import { biliToolsDeclaredOnWire } from "../session-self-heal.js"; import { extractBillingAttributionBlock } from "../preflight.js"; import { ANONYMOUS, hostProfileFor, type HostProfile } from "../host-profiles.js"; +import { RUN_CODE_TOOL_NAME } from "../compress-tool.js"; type LaneProtocol = "anthropic" | "openai" | "google" | "responses"; @@ -227,7 +228,7 @@ export function resolveLaneDecisions(input: LaneDecisionInput): LaneDecisions { // surface on every dsh PTC session until the window hit 100%). const compressReachable = !input.pluginMode || declaredTools.has("compress") - || declaredTools.has("run_code") + || declaredTools.has(RUN_CODE_TOOL_NAME) || !profile.toolsHostScopedByDefault; const compressSurfaceOn = input.shouldInject && compressReachable; const billingBlockObserved = extractBillingAttributionBlock(systemOf(input.parsed)) !== undefined;