{"record":{"id":"a7b76e62a543be63","repo":"can1357/oh-my-pi","slug":"name-cannot-run-through-the-eval-bridge-ca","errorCode":null,"errorMessage":"\\`${name}\\` cannot run through the eval bridge; call the direct \\`${name}\\` tool.","messagePattern":"\\\\`(.+?)\\\\` cannot run through the eval bridge; call the direct \\\\`(.+?)\\\\` tool\\.","errorType":"exception","errorClass":"ToolError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/eval/js/tool-bridge.ts","lineNumber":126,"sourceCode":"}\n\nexport async function callSessionTool(name: string, args: unknown, options: ToolBridgeOptions): Promise<ToolValue> {\n\tif (name === EVAL_COMPLETION_BRIDGE_NAME) {\n\t\treturn await runEvalCompletion(args, options);\n\t}\n\tif (name === EVAL_AGENT_BRIDGE_NAME) {\n\t\treturn await runEvalAgent(args, options);\n\t}\n\tif (name === EVAL_BUDGET_BRIDGE_NAME) {\n\t\treturn await runEvalBudget(args, options);\n\t}\n\tif (name === EVAL_CONCURRENCY_BRIDGE_NAME) {\n\t\treturn runEvalConcurrency(args, options);\n\t}\n\tif (name === \"checkpoint\" || name === \"rewind\") {\n\t\t// The session recognizes checkpoint/rewind only as direct toolResult\n\t\t// messages; a bridged call would report success without taking effect.\n\t\tthrow new ToolError(`\\`${name}\\` cannot run through the eval bridge; call the direct \\`${name}\\` tool.`);\n\t}\n\tconst tool = getTool(options.session, name);\n\tconst normalizedArgs = normalizeArgs(args);\n\tconst toolCallId = `js-${name}-${crypto.randomUUID()}`;\n\ttry {\n\t\tconst result = await tool.execute(\n\t\t\ttoolCallId,\n\t\t\tnormalizedArgs,\n\t\t\toptions.signal,\n\t\t\tundefined,\n\t\t\toptions.session.getToolContext?.(),\n\t\t);\n\t\tconst textBlocks = result.content.filter(\n\t\t\t(content): content is { type: \"text\"; text: string } =>\n\t\t\t\tcontent.type === \"text\" && typeof content.text === \"string\",\n\t\t);\n\t\tconst imageBlocks = result.content.filter(\n\t\t\t(content): content is { type: \"image\"; mimeType: string; data: string } =>","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/eval/js/tool-bridge.ts#L108-L144","documentation":"`checkpoint` and `rewind` are special-cased in `callSessionTool`: the session only honors them as direct toolResult messages, so a bridged call from JS eval would report success without actually taking effect. The bridge deliberately rejects these names with a `ToolError` instructing the caller to use the direct tool instead.","triggerScenarios":"Invoking `tool(\"checkpoint\", ...)` or `tool(\"rewind\", ...)` from within the JS eval bridge runtime.","commonSituations":"Eval scripts attempting to snapshot or restore session state programmatically, assuming all tools are bridged equally.","solutions":["Don't call checkpoint/rewind from eval code; end the eval run and let the agent emit the direct toolResult message","Restructure the workflow so checkpoint/rewind is triggered by the agent's normal tool call path","If programmatic control is needed, use the SDK/session API that supports checkpoint semantics directly rather than the eval bridge"],"exampleFix":"// before (eval code)\nawait tool(\"checkpoint\", {});\n// after: call checkpoint as a direct tool call in the agent loop, not via eval bridge\n// or remove the call and let the agent issue the checkpoint itself","handlingStrategy":"validation","validationCode":"const BRIDGE_BLOCKED = new Set([\"checkpoint\", \"rewind\"]);\nif (BRIDGE_BLOCKED.has(name)) {\n  throw new Error(`${name} must be issued as a direct tool call, not via the eval bridge`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await tool(\"checkpoint\", {});\n} catch (err) {\n  if (err instanceof ToolError && /cannot run through the eval bridge/.test(err.message)) {\n    // defer: request the agent to issue checkpoint directly\n  }\n}","preventionTips":["Never call checkpoint/rewind from eval-bridged code","Keep state snapshot/restore logic in the agent's direct tool path","Document which tools are bridge-restricted for eval script authors"],"tags":["tool-bridge","eval","checkpoint","unsupported"],"backgroundTag":"unsupported-tool-via-bridge","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}