mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
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.
This commit is contained in:
@@ -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)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user