8a5b3e9552
- Removed per-session run queues from JS and Python backends, allowing async cells on the same session id to interleave. - Introduced `getEvalSessionId` on ToolSession so subagents spawned via `task` inherit the parent's executor id and share JS VM and Python kernel state. - Switched JS runtime state from module-level fields to AsyncLocalStorage so concurrent runs route output and tool calls to their own context. - Changed Python runner to an asyncio event loop with per-request tasks and ContextVar-based run id tracking for concurrent execution. - Added mtime-based module cache eviction to preserve singleton state across re-imports of unchanged local files.
9 lines
353 B
TypeScript
9 lines
353 B
TypeScript
import type { ToolSession } from "../tools";
|
|
|
|
export type EvalSessionSource = Pick<ToolSession, "cwd" | "getSessionFile">;
|
|
|
|
export function defaultEvalSessionId(session: EvalSessionSource): string {
|
|
const sessionFile = session.getSessionFile?.() ?? undefined;
|
|
return sessionFile ? `session:${sessionFile}:cwd:${session.cwd}` : `cwd:${session.cwd}`;
|
|
}
|