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) ) }