diff --git a/packages/sdk-typescript/src/daemon/acpRouteTable.ts b/packages/sdk-typescript/src/daemon/acpRouteTable.ts index f29cd5e408a..032dbeefb7d 100644 --- a/packages/sdk-typescript/src/daemon/acpRouteTable.ts +++ b/packages/sdk-typescript/src/daemon/acpRouteTable.ts @@ -12,10 +12,19 @@ // prevents route inconsistencies between the two transport variants. // --------------------------------------------------------------------------- -import { isRecord } from './acpTransportUtils.js'; - const REQUESTED_SESSION_ID_META_KEY = 'qwen-code/sessionId'; +// Kept local (instead of reusing `isRecord` from `acpTransportUtils.ts`): +// acpTransportUtils imports this module's ROUTE_TABLE, so re-importing the +// predicate from there would silently restore the +// acpRouteTable -> acpTransportUtils -> acpRouteTable runtime cycle this +// change exists to break. ESM cycles compile and test green, so the guard is +// this comment — do not consolidate without breaking the cycle some other +// way first. +function isRecord(value: unknown): value is Record { + return typeof value === 'object' && value !== null && !Array.isArray(value); +} + export interface RouteMapping { method: string; /**