openclaw - 💡(How to fix) Fix Bundler: unhashed runtime-model-auth.runtime.js stub missing from dist/, breaks image.generate + any capability using runtime model auth [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#70914Fetched 2026-04-24 10:37:54
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
closed ×1commented ×1

Builds from current main (as of 2026-04-23, tip f1ad5e27e0) no longer emit the unhashed dist/runtime-model-auth.runtime.{js,ts,mjs,...} stub that resolveRuntimeModelAuthModuleHref() in dist/provider-auth-runtime-*.js walks a candidate list to locate. Only hashed chunks exist, so the resolver exhausts its candidate list and throws:

``` Error: Unable to resolve runtime model auth module from file:///<repo>/dist/provider-auth-runtime-<hash>.js ```

Every capability that uses runtime model auth resolution fails: image generation, embeddings, probably audio / any provider-auth runtime path.

Error Message

Error: Unable to resolve runtime model auth module from file:///<repo>/dist/provider-auth-runtime-<hash>.js 4. See the error above. Attempt list also shows the same missing-module error for fallback candidates (openai/gpt-image-2, xai/grok-imagine-image), confirming the issue is resolver-level not provider-specific. throw new Error(`Unable to resolve runtime model auth module from ${import.meta.url}`);

Root Cause

The resolver at `dist/provider-auth-runtime-*.js`:

```js const RUNTIME_MODEL_AUTH_CANDIDATES = [ "./runtime-model-auth.runtime", "../plugins/runtime/runtime-model-auth.runtime", ]; const RUNTIME_MODEL_AUTH_EXTENSIONS = [".js", ".ts", ".mjs", ".mts", ".cjs", ".cts"];

function resolveRuntimeModelAuthModuleHref() { const baseDir = path.dirname(fileURLToPath(import.meta.url)); for (const relativeBase of RUNTIME_MODEL_AUTH_CANDIDATES) for (const ext of RUNTIME_MODEL_AUTH_EXTENSIONS) { const candidate = path.resolve(baseDir, `${relativeBase}${ext}`); if (fs.existsSync(candidate)) return pathToFileURL(candidate).href; } throw new Error(`Unable to resolve runtime model auth module from ${import.meta.url}`); } ```

It expects an unhashed `runtime-model-auth.runtime.js` sibling (or the ../plugins/runtime/ variant). On main only the hashed chunks exist:

``` dist/ runtime-model-auth.runtime-BnNsQZc0.js <- main bundle runtime-model-auth.runtime-C8pJ24BQ.js <- clean re-exporter ```

Fix Action

Fix / Workaround

Local workaround

Reproduced on a custom fork (wipcomputer/openclaw) built from upstream main during image-generation testing on Codex/gpt-5.5 provider. Discovery and hotfix by agents in a live debugging session; verified fix shipped an image end-to-end to iMessage via imsg --file on 2026-04-23 20:18 PDT.

RAW_BUFFERClick to expand / collapse

Summary

Builds from current main (as of 2026-04-23, tip f1ad5e27e0) no longer emit the unhashed dist/runtime-model-auth.runtime.{js,ts,mjs,...} stub that resolveRuntimeModelAuthModuleHref() in dist/provider-auth-runtime-*.js walks a candidate list to locate. Only hashed chunks exist, so the resolver exhausts its candidate list and throws:

``` Error: Unable to resolve runtime model auth module from file:///<repo>/dist/provider-auth-runtime-<hash>.js ```

Every capability that uses runtime model auth resolution fails: image generation, embeddings, probably audio / any provider-auth runtime path.

Reproduction

  1. Check out main (verified on f1ad5e27e0).
  2. pnpm install && pnpm build
  3. openclaw infer image generate --provider openai-codex --model gpt-image-2 --prompt "test" (or any capability that touches runtime model auth).
  4. See the error above. Attempt list also shows the same missing-module error for fallback candidates (openai/gpt-image-2, xai/grok-imagine-image), confirming the issue is resolver-level not provider-specific.

Root cause

The resolver at `dist/provider-auth-runtime-*.js`:

```js const RUNTIME_MODEL_AUTH_CANDIDATES = [ "./runtime-model-auth.runtime", "../plugins/runtime/runtime-model-auth.runtime", ]; const RUNTIME_MODEL_AUTH_EXTENSIONS = [".js", ".ts", ".mjs", ".mts", ".cjs", ".cts"];

function resolveRuntimeModelAuthModuleHref() { const baseDir = path.dirname(fileURLToPath(import.meta.url)); for (const relativeBase of RUNTIME_MODEL_AUTH_CANDIDATES) for (const ext of RUNTIME_MODEL_AUTH_EXTENSIONS) { const candidate = path.resolve(baseDir, `${relativeBase}${ext}`); if (fs.existsSync(candidate)) return pathToFileURL(candidate).href; } throw new Error(`Unable to resolve runtime model auth module from ${import.meta.url}`); } ```

It expects an unhashed `runtime-model-auth.runtime.js` sibling (or the ../plugins/runtime/ variant). On main only the hashed chunks exist:

``` dist/ runtime-model-auth.runtime-BnNsQZc0.js <- main bundle runtime-model-auth.runtime-C8pJ24BQ.js <- clean re-exporter ```

How v2026.4.22 worked

v2026.4.22 shipped a third file, a one-line re-export stub:

``` dist/runtime-model-auth.runtime.js: export * from "./runtime-model-auth.runtime-<hash>.js"; ```

The bundler config emitted that alongside the hashed chunks, so the resolver found it on the first candidate. That unhashed stub is not emitted in current main builds.

Suggested fix

Two paths:

  1. Bundler config: re-emit the unhashed stub. Presumably `tsdown` config or a post-build script used to write `runtime-model-auth.runtime.js` as a re-export of the clean entry chunk. Restore that emission. Least surprise for the runtime resolver.
  2. Resolver: use the bundle's import graph instead of filesystem probing. The clean entry chunk (`runtime-model-auth.runtime-<hash>.js`) is the intended entry; the resolver could import it via a statically-known identifier rather than fs.existsSync. Bigger change but removes the unhashed-stub requirement.

Option 1 is the minimal fix and restores parity with v2026.4.22.

Local workaround

Create the stub manually in the built dist:

``` cat > dist/runtime-model-auth.runtime.js <<'MJS' export * from "./runtime-model-auth.runtime-<whichever-C-hash>.js"; MJS ```

Confirmed: with this one-line file in place, `openclaw infer image generate` completes end-to-end on `openai-codex/gpt-image-2` via OAuth. Same fix unblocks other runtime-model-auth callers.

Discovered

Reproduced on a custom fork (wipcomputer/openclaw) built from upstream main during image-generation testing on Codex/gpt-5.5 provider. Discovery and hotfix by agents in a live debugging session; verified fix shipped an image end-to-end to iMessage via imsg --file on 2026-04-23 20:18 PDT.

Happy to submit a PR restoring the bundler-emitted stub if you can point me at the emission site.

extent analysis

TL;DR

The most likely fix is to re-emit the unhashed runtime-model-auth.runtime.js stub in the bundler config or a post-build script.

Guidance

  • Identify the bundler config or post-build script responsible for emitting the runtime-model-auth.runtime.js stub and restore its emission.
  • Verify that the stub is being generated correctly by checking the dist directory for the presence of runtime-model-auth.runtime.js.
  • As an alternative, consider modifying the resolver to use the bundle's import graph instead of filesystem probing, but this approach may require more significant changes.
  • To temporarily workaround the issue, create the stub manually in the built dist directory using the provided command.

Example

// Manual workaround
cat > dist/runtime-model-auth.runtime.js <<'MJS'
export * from "./runtime-model-auth.runtime-<whichever-C-hash>.js";
MJS

Notes

The issue is specific to the current main branch and is caused by the absence of the unhashed runtime-model-auth.runtime.js stub. The suggested fix aims to restore the previous behavior, but alternative approaches may be explored.

Recommendation

Apply the workaround by re-emitting the unhashed stub, as it is the minimal fix and restores parity with the previous version.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING