BigPizzaV3/CodexPlusPlus · error · Error
当前 Codex 版本未提供兼容的 HTTP 服务
Error message
当前 Codex 版本未提供兼容的 HTTP 服务
What it means
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.
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
Example fix
// before
if(typeof native.lGt!=='function')throw localError('当前 Codex 版本未提供兼容的 HTTP 服务');
// after
if(typeof native.lGt!=='function')throw localError(`当前 Codex 版本未提供兼容的 HTTP 服务(Codex ${window.__codexVersion||'未知'}),请更新对话脉络脚本`); Defensive patterns
Strategy: type-guard
Validate before calling
const native=await loadNativeRuntime();if(typeof native?.lGt!=='function'){showUnsupported('HTTP 服务');return;} Type guard
const hasHttpService=(n)=>typeof n?.lGt==='function';
Try / catch
try{await nativeApiRequest(url,opts);}catch(e){if(e.canvasApiLocal&&/HTTP 服务/.test(e.message)){queueWhenReady(retry);}else throw e;} Prevention
- 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
When it happens
Trigger: nativeApiRequest called on a Codex build whose runtime object has no lGt export (binding renamed/removed in that Codex version).
Common situations: Codex app updated and internal HTTP service binding renamed; script's binding map outdated; running against an unofficial/patched Codex build.
Understand the failure class
Background: "is not a compatible type" / "cannot merge" errors: when a value's type doesn't match what the library requires — this error's family across 65 libraries.
Related errors
- 当前 Codex 版本的 API 适配器不兼容,请更新对话脉络脚本
- 当前 Codex 版本的对话读取接口不兼容
- 当前 Codex 版本尚未适配对话脉络,请更新插件;已有整理结果仍保留
- 当前 Codex 的 HTTP 服务尚未就绪,请稍后重试
- discovered.some(url=>!nativeBuilds[url.split('/').pop()])?'当…
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19).
Data as JSON: /api/errors/2e469d4a50b37320.
Report an issue: GitHub.
Appendix: source
Thrown at tools/conversation-canvas/src/native-api.js:6
// 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)