From 0c439edc4ae40b9481d97cea6f745fc732cc26ae Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Thu, 24 Sep 2026 13:24:16 -0700 Subject: [PATCH] perf(cli): keep the session caller check off the actor codec's module graph The check runs at the CLI entry for every command, and the actor codec pulls zod through the session record. Compare the session's own spellings as plain strings instead. --- src/cli/session-caller-flags.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cli/session-caller-flags.ts b/src/cli/session-caller-flags.ts index b136bccb4bc..1ef820d7fee 100644 --- a/src/cli/session-caller-flags.ts +++ b/src/cli/session-caller-flags.ts @@ -11,7 +11,6 @@ import type { CommandSpec, IdentityFlag } from './command-spec' import { RuntimeClientError } from './runtime/types' import { readInjectedAgentSessionId } from '../shared/agent-session-caller-env' -import { normalizeOrchestrationActor } from '../shared/orchestration-actor' import { isStructuredWorkerHandle } from '../shared/structured-worker-handle' export function refuseConflictingSessionCallerFlags( @@ -42,10 +41,13 @@ export function refuseConflictingSessionCallerFlags( const IDENTITY_FLAGS: readonly IdentityFlag[] = ['from', 'terminal'] -/** The session's own spellings, plus the handle a structured worker session was minted. */ +/** + * The session's own spellings, plus the handle a structured worker session was minted. Plain + * strings: this runs at the CLI entry for every command, before the actor codec's module graph. + */ function namesInjectedSession(value: string, sessionId: string, env: NodeJS.ProcessEnv): boolean { return ( - normalizeOrchestrationActor(value)?.id === sessionId || value === injectedSessionAddress(env) + value === sessionId || value === `session:${sessionId}` || value === injectedSessionAddress(env) ) }