MCPcopy Create free account
hub / github.com/agent-tower/core / spawn

Method spawn

packages/server/src/executors/codex.executor.ts:311–341  ·  view source on GitHub ↗

* 启动新会话

(config: ExecutorSpawnConfig)

Source from the content-addressed store, hash-verified

309}
310
311/** Return a snapshot immediately while a single-flight CLI probe refreshes it. */
312export function getCachedCodexMcpServerNames(
313 configOverrideArgs: string[] = [],
314 fallbackConfigPath?: string,
315 probeCommand?: CommandParts,
316 environment?: NodeJS.ProcessEnv,
317 workingDir?: string,
318): Set<string> {
319 return new Set(getCodexMcpServerCacheEntry(
320 configOverrideArgs, fallbackConfigPath, probeCommand, environment, workingDir,
321 ).names);
322}
323
324/** Wait asynchronously for effective project config before constructing launch overrides. */
325export async function getCodexMcpServerNamesForLaunch(
326 configOverrideArgs: string[] = [],
327 fallbackConfigPath?: string,
328 probeCommand?: CommandParts,
329 environment?: NodeJS.ProcessEnv,
330 workingDir?: string,
331): Promise<Set<string>> {
332 const entry = getCodexMcpServerCacheEntry(
333 configOverrideArgs, fallbackConfigPath, probeCommand, environment, workingDir,
334 );
335 // Parsing project files ourselves could disable MCPs ignored by Codex's trust
336 // rules and create invalid transport-less entries. Await this key's CLI probe.
337 await entry.refreshPromise;
338 return new Set(entry.names);
339}
340
341/** Test-only reset hook; no production caller should need to clear this cache. */
342export function resetCodexMcpServerCache(): void {
343 codexMcpCache.clear();
344}

Callers

nothing calls this directly

Calls 9

buildCommandBuilderMethod · 0.95
buildConfigOverridesMethod · 0.95
combinePromptMethod · 0.95
detectDeclaredMcpServersFunction · 0.85
extractImagePathsFunction · 0.85
extendParamsMethod · 0.80
buildInitialMethod · 0.80

Tested by

no test coverage detected