{"record":{"id":"2e469d4a50b37320","repo":"BigPizzaV3/CodexPlusPlus","slug":"codex-http-native-api","errorCode":null,"errorMessage":"当前 Codex 版本未提供兼容的 HTTP 服务","messagePattern":"当前 Codex 版本未提供兼容的 HTTP 服务","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"tools/conversation-canvas/src/native-api.js","lineNumber":6,"sourceCode":"// HTTP uses the app host, with versioned runtime bindings, not renderer fetch/CSP.\nasync function nativeApiRequest(url,options){\n  const localError=message=>Object.assign(Error(message),{canvasApiLocal:true});\n  let native;\n  try{native=await loadNativeRuntime();}catch{throw localError('当前 Codex 版本的 API 适配器不兼容，请更新对话脉络脚本');}\n  if(typeof native.lGt!=='function')throw localError('当前 Codex 版本未提供兼容的 HTTP 服务');\n  native.lGt();\n  const client=native.cGt?.getInstance?.();\n  if(typeof client?.fetch!=='function'||!native.jR?.httpFetch)throw localError('当前 Codex 的 HTTP 服务尚未就绪，请稍后重试');\n  const {onProgress,...fetchOptions}=options;\n  const response=await client.fetch(url,fetchOptions);\n  return readApiResponse(response,options.signal,onProgress);\n}\n","sourceCodeStart":1,"sourceCodeEnd":14,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/tools/conversation-canvas/src/native-api.js#L1-L14","documentation":"After the runtime loads, nativeApiRequest verifies the native binding exposes an lGt function (the HTTP service entry). If the loaded runtime lacks it, the current Codex version provides no compatible HTTP service and this error is thrown.","triggerScenarios":"nativeApiRequest called on a Codex build whose runtime object has no lGt export (binding renamed/removed in that Codex version).","commonSituations":"Codex app updated and internal HTTP service binding renamed; script's binding map outdated; running against an unofficial/patched Codex build.","solutions":["Update the canvas script to a version whose binding map matches the installed Codex","Verify the Codex version against the script's compatibility table","Report the missing binding upstream with your Codex version number"],"exampleFix":"// before\nif(typeof native.lGt!=='function')throw localError('当前 Codex 版本未提供兼容的 HTTP 服务');\n// after\nif(typeof native.lGt!=='function')throw localError(`当前 Codex 版本未提供兼容的 HTTP 服务（Codex ${window.__codexVersion||'未知'}），请更新对话脉络脚本`);","handlingStrategy":"type-guard","validationCode":"const native=await loadNativeRuntime();if(typeof native?.lGt!=='function'){showUnsupported('HTTP 服务');return;}","typeGuard":"const hasHttpService=(n)=>typeof n?.lGt==='function';","tryCatchPattern":"try{await nativeApiRequest(url,opts);}catch(e){if(e.canvasApiLocal&&/HTTP 服务/.test(e.message)){queueWhenReady(retry);}else throw e;}","preventionTips":["Probe all required bindings once at startup and disable dependent features if missing","Maintain a Codex-version → binding-map table","Log typeof checks for missing bindings to speed up version-mismatch reports"],"tags":["runtime-binding","http-service","version-incompatibility"],"backgroundTag":"incompatible-source-type","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}