BigPizzaV3/CodexPlusPlus · error

当前 Codex 版本尚未适配对话脉络,请更新插件;已有整理结果仍保留

Error message

当前 Codex 版本尚未适配对话脉络,请更新插件;已有整理结果仍保留

What it means

bindNativeRuntime maps minified exports of the Codex Desktop's app-initial bundle to the plugin's adapter, using the hardcoded `nativeBuilds` table keyed by exact asset filename. If the bundle filename is not in the table, the plugin has no reviewed export mapping for that Desktop build and throws, telling the user to update the plugin while preserving existing organized results.

Solutions

  1. Update the plugin to the latest release, which should contain a reviewed mapping for the new app-initial bundle hash.
  2. Add an entry to `nativeBuilds` in native-runtime.mjs mapping the new filename to the current build's minified export names (verify each export against the bundle).
  3. Pin/roll back the Codex Desktop version to one whose asset hash is present in nativeBuilds.

Example fix

// before
export const nativeBuilds={
  'app-initial-f87238153a19.js':{ESt:'ESt',kr:'kr',Mr:'Mr',Q1:'Q1',lGt:'lGt',cGt:'cGt',jR:'jR'},
};
// after
export const nativeBuilds={
  'app-initial-f87238153a19.js':{ESt:'ESt',kr:'kr',Mr:'Mr',Q1:'Q1',lGt:'lGt',cGt:'cGt',jR:'jR'},
  'app-initial-<newhash>.js':{ESt:'<newESt>',kr:'<newKr>',Mr:'<newMr>',Q1:'<newQ1>',lGt:'<newLGt>',cGt:'<newCGt>',jR:'<newJR>'},
};
Defensive patterns

Strategy: try-catch

Validate before calling

const supported=Object.keys(nativeBuilds);
const filename=assetUrl.split('/').pop();
if(!supported.includes(filename))throw new Error('unsupported Codex build: '+filename);

Type guard

function isSupportedBuild(filename){return typeof filename==='string'&&filename in nativeBuilds;}

Try / catch

try{adapter=bindNativeRuntime(module,filename);}catch(e){showUpdatePromptPreservingResults(e.message);return null;}

Prevention

When it happens

Trigger: Calling `bindNativeRuntime(module, filename)` where `nativeBuilds[filename]` is undefined — i.e. a filename other than 'app-initial-f87238153a19.js' or 'app-initial-bcc2ff475eb6.js' (both directly, or via createNativeLoader's per-candidate check that skips unknown files).

Common situations: Codex Desktop auto-updated, producing a new hashed app-initial-*.js filename; running a dev/nightly Desktop build; plugin not updated after a Desktop release.

Related errors


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

Appendix: source

Thrown at tools/conversation-canvas/native-runtime.mjs:14

// Private Desktop exports change between builds. Only bind reviewed contracts;
// discovering a new asset does not make its minified export names compatible.
export const nativeBuilds={
  'app-initial-f87238153a19.js':{ESt:'ESt',kr:'kr',Mr:'Mr',Q1:'Q1',lGt:'lGt',cGt:'cGt',jR:'jR'},
  'app-initial-bcc2ff475eb6.js':{ESt:'EDt',kr:'MDt',lGt:'hJt',cGt:'mJt',jR:'TW'},
};
export function nativeAssetCandidates(doc=globalThis.document,perf=globalThis.performance){
  const urls=[...Array.from(doc?.querySelectorAll?.('script[src],link[rel="modulepreload"][href]')||[],e=>e.src||e.href),
    ...(perf?.getEntriesByType?.('resource')||[]).map(e=>e.name)];
  return [...new Set(urls.filter(url=>/^app:\/\/-\/assets\/app-initial-[\w-]+\.js$/.test(url)))];
}
export function bindNativeRuntime(module,filename){
  const mapping=nativeBuilds[filename];
  if(!mapping)throw Error('当前 Codex 版本尚未适配对话脉络,请更新插件;已有整理结果仍保留');
  const adapter={};
  // Keep live bindings: initialization populates the HTTP class and services.
  for(const [key,value] of Object.entries(mapping))Object.defineProperty(adapter,key,{get:()=>module[value]});
  return adapter;
}
export function createNativeLoader({discover=nativeAssetCandidates,importModule=url=>import(url)}={}){
  let pending;
  return function load(){
    if(!pending)pending=(async()=>{
      const discovered=discover();
      // Without resource timing (e.g. after a reload), try reviewed builds only.
      const candidates=discovered.length?discovered:Object.keys(nativeBuilds).reverse().map(name=>'app://-/assets/'+name);
      for(const url of candidates){
        const filename=url.split('/').pop();
        if(!nativeBuilds[filename])continue;
        let module;
        try{module=await importModule(url);}catch{continue;}
        return bindNativeRuntime(module,filename);

View on GitHub (pinned to b1ed92e5e4)