BigPizzaV3/CodexPlusPlus · error
Codex setting-storage 接口不可用
Error message
Codex setting-storage 接口不可用 (${errors.join("; ")}) What it means
codexSettingStorageModule() probes one or more injected asset prefixes (webpack chunk require) trying to obtain Codex's setting-storage exports. Every probe throws (module renamed, chunk not loaded, bundler internals changed), and after exhausting all prefixes it aggregates the collected messages into this error. It indicates the inject script can no longer reach Codex's internal settings API surface.
Solutions
- Update the inject script to the module ids/paths used by the installed Codex version (check the error's per-prefix messages for which probes failed).
- Retry probing after a delay to let lazy chunks load.
- Add new assetPrefix candidates covering the renamed module.
- Pin/downgrade Codex to a version compatible with the inject script.
Example fix
// before
const settingStorage = await codexSettingStorageModule();
// after
let settingStorage;
try { settingStorage = await codexSettingStorageModule(); }
catch (e) { console.warn("setting-storage probe failed:", e.message); await sleep(1000); settingStorage = await codexSettingStorageModule(); } Defensive patterns
Strategy: fallback
Validate before calling
let ok = false; try { ok = !!(await codexSettingStorageModule()); } catch { ok = false; } if (!ok) { /* show "Codex 版本不兼容" banner */ } Type guard
function isSettingStorage(mod) { return !!mod && typeof mod === "object"; } Try / catch
try { const storage = await codexSettingStorageModule(); } catch (e) { console.warn(e.message); notifyUser("Codex 设置接口不可用,请更新注入脚本"); return null; } Prevention
- Ship inject script updates alongside each Codex release you support.
- Log each per-prefix probe error to speed up diagnosing renamed modules.
- Delay first probe until the app's chunks are loaded (e.g. after app-ready event).
When it happens
Trigger: Calling getCodexServiceTierSetting() (or any setting read) when all `assetPrefix` probes fail: Codex app updated and the setting-storage module id/path changed, webpack chunk graph changed, or the inject script loads before the target chunk exists.
Common situations: Codex desktop/renderer upgraded with refactored internals; inject script version lagging behind the app; CSP or bundling changes blocking the chunk require; race where probing runs before lazy chunks load.
Related errors
- Codex 状态 API 不可用 ( )
- 当前 Codex 版本的后台整理接口尚未适配,请在设置中使用外接 API 整理
- 侧边对话初始化未完成
- 本批整理中断,已完成批次已保存,可点击继续
- 上次提交结果尚未确认,请稍后点击继续
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19).
Data as JSON: /api/errors/1a4f1f9577239f16.
Report an issue: GitHub.
Appendix: source
Thrown at assets/inject/renderer-inject.js:2647
}
return typeof getSetting === "function" && typeof setSetting === "function"
? { n: getSetting, s: setSetting, assetPrefix }
: null;
}
async function codexSettingStorageModule() {
const errors = [];
for (const assetPrefix of ["setting-storage-", "app-initial-"]) {
try {
const module = await loadCodexAppModule(assetPrefix);
const settingStorage = codexSettingStorageFromModule(module, assetPrefix);
if (settingStorage) return settingStorage;
errors.push(`${assetPrefix}: setting exports unavailable`);
} catch (error) {
errors.push(`${assetPrefix}: ${error?.message || String(error)}`);
}
}
throw new Error(`Codex setting-storage 接口不可用 (${errors.join("; ")})`);
}
async function getCodexServiceTierSetting() {
try {
const read = (async () => {
const settingStorage = await codexSettingStorageModule();
return await settingStorage.n(codexDefaultServiceTierSetting);
})();
return await Promise.race([
read,
new Promise((_, reject) => setTimeout(() => reject(new Error("Codex 应用设置读取超时")), codexServiceTierReadTimeoutMs)),
]);
} catch (error) {
if (typeof codexStateCall === "function") {
const fallbackRead = codexStateCall("get-setting", { params: { key: codexDefaultServiceTierSetting.key } });
const result = await Promise.race([
fallbackRead,
new Promise((_, reject) => setTimeout(() => reject(error), codexServiceTierReadTimeoutMs)),View on GitHub (pinned to b1ed92e5e4)