BigPizzaV3/CodexPlusPlus · error · Error

当前 Codex 的 HTTP 服务尚未就绪,请稍后重试

Error message

当前 Codex 的 HTTP 服务尚未就绪,请稍后重试

What it means

nativeApiRequest checks that the native HTTP client is fully ready: client.fetch must be a function and the jR.httpFetch binding present. If either is missing, the HTTP service exists but is not ready, and this retry-later error is thrown.

Solutions

  1. Wait a few seconds and click refresh — the HTTP service usually finishes initializing
  2. Reload the Codex window to restart service initialization
  3. If it persists, reinstall/repair the Codex app
  4. Check the script for a readiness-retry before calling nativeApiRequest

Example fix

// before
if(typeof client?.fetch!=='function'||!native.jR?.httpFetch)throw localError('当前 Codex 的 HTTP 服务尚未就绪,请稍后重试');
// after
for(let i=0;i<5&&(typeof client?.fetch!=='function'||!native.jR?.httpFetch);i++)await new Promise(r=>setTimeout(r,1000));
if(typeof client?.fetch!=='function'||!native.jR?.httpFetch)throw localError('当前 Codex 的 HTTP 服务尚未就绪,请稍后重试');
Defensive patterns

Strategy: retry

Validate before calling

const ready=await poll(()=>{const c=native.cGt?.getInstance?.();return typeof c?.fetch==='function'&&!!native.jR?.httpFetch;},{timeout:10000});

Type guard

const httpReady=(n)=>typeof n?.cGt?.getInstance?.()?.fetch==='function'&&!!n?.jR?.httpFetch;

Try / catch

try{await nativeApiRequest(url,opts);}catch(e){if(/尚未就绪/.test(e.message)){await sleep(3000);return retry();}throw e;}

Prevention

When it happens

Trigger: nativeApiRequest invoked during app startup before the native HTTP client singleton is initialized (cGt.getInstance() returns an object without fetch, or jR.httpFetch is undefined).

Common situations: Canvas script runs immediately after Codex app launch before the HTTP service initializes; app still bootstrapping after a reload; partially-failed Codex update left the HTTP service uninitialized.

Understand the failure class

Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/4b14da26596db555. Report an issue: GitHub.

Appendix: source

Thrown at tools/conversation-canvas/src/native-api.js:9

// HTTP uses the app host, with versioned runtime bindings, not renderer fetch/CSP.
async function nativeApiRequest(url,options){
  const localError=message=>Object.assign(Error(message),{canvasApiLocal:true});
  let native;
  try{native=await loadNativeRuntime();}catch{throw localError('当前 Codex 版本的 API 适配器不兼容,请更新对话脉络脚本');}
  if(typeof native.lGt!=='function')throw localError('当前 Codex 版本未提供兼容的 HTTP 服务');
  native.lGt();
  const client=native.cGt?.getInstance?.();
  if(typeof client?.fetch!=='function'||!native.jR?.httpFetch)throw localError('当前 Codex 的 HTTP 服务尚未就绪,请稍后重试');
  const {onProgress,...fetchOptions}=options;
  const response=await client.fetch(url,fetchOptions);
  return readApiResponse(response,options.signal,onProgress);
}

View on GitHub (pinned to b1ed92e5e4)