diegosouzapw/OmniRoute · error · Error

ChatGPT Web (Codex) tools require Tunnel-ID and Runtime-Key

Error message

ChatGPT Web (Codex) tools require Tunnel-ID and Runtime-Key

What it means

Execute-time guard for non-Pro routes with tools: the tool path requires the tunnel runtime, but the Tunnel-ID and/or Runtime-Key are absent from the connection/env configuration. These credentials authenticate the tunnel-client that exposes the Custom Connector, so without them tool-enabled requests cannot proceed.

Solutions

  1. Configure the Tunnel-ID (tunnel_ + 32 hex chars) and Runtime-Key on the chatgpt-web connection
  2. Set them via the supported env variables if not using per-connection fields
  3. Disable tools on requests meant to run without the tunnel runtime
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at open-sse/executors/chatgpt-web-codex.ts:337 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/b37692b5b90f28ec. Report an issue: GitHub.

Appendix: source

Thrown at open-sse/executors/chatgpt-web-codex.ts:337

        if (cdpEndpoint) providerData.browserCdpEndpoint = cdpEndpoint;
        await input.onCredentialsRefreshed?.({
          providerSpecificData: {
            ...record(input.credentials.providerSpecificData),
            proAvailable: capabilities.proAvailable,
            browserVerified: true,
            ...(chromeExecutablePath ? { chromeExecutablePath } : {}),
            ...(cdpEndpoint ? { browserCdpEndpoint: cdpEndpoint } : {}),
          },
        });
      }
      const routeUsesTools = !route.pro && toolModeRequired(parsed);
      if (routeUsesTools) {
        const tunnelId =
          configuredString(providerData, "tunnelId") ??
          process.env.CHATGPT_WEB_CODEX_TUNNEL_ID?.trim();
        const runtimeKey = secrets.runtimeKey ?? process.env.CHATGPT_WEB_CODEX_RUNTIME_KEY?.trim();
        if (!tunnelId || !runtimeKey) {
          throw new Error("ChatGPT Web (Codex) tools require Tunnel-ID and Runtime-Key");
        }
        await ensureTunnelRuntimeReady({
          tunnelId,
          runtimeKey,
          brokerSocketPath: connectionRuntimePaths(connectionId).brokerSocketPath,
        });
      }
      const provider = buildProviderConfig(
        {
          ...input,
          credentials: { ...input.credentials, providerSpecificData: providerData },
        },
        parsed,
        storageStatePath,
        connectionId
      );
      const adapter = createChatGptWebAdapter(provider);
      const worker = ChatGptBrowserWorker.forProvider(provider);

View on GitHub (pinned to a179ffed5b)