You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading to 2026.4.24, openclaw gateway hangs during startup when LiteLLM and OpenRouter pricing fetch requests time out, making the dashboard inaccessible and Ctrl+C unable to exit.
In 2026.4.21, the same pricing fetch failures occur but gateway continues to start normally and the dashboard is accessible.
Actual behavior
Gateway hangs after pricing fetch timeout. No further output. Ctrl+C does not respond. Dashboard URL unreachable. Must kill node processes from another terminal.
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.
Summary
Keep open. Current main still has pricing-startup mitigations, but the model-pricing refresh remains timeout-only and is not fully tied to Gateway shutdown, so the Ctrl+C/hanging-lifecycle part of the report is still actionable.
Reproducibility: yes. The issue has concrete released-package steps, and current main has a source-level reproduction path: start a pricing refresh with hanging fetches, call the stop callback while it is in flight, then assert the fetches abort and no post-stop timer/cache mutation occurs.
Next step
This is a narrow runtime lifecycle repair with clear files and focused tests; it does not require product or security review first.
Review details
Best possible solution:
Keep the existing startup mitigations, then make model-pricing refresh stop-aware: compose a Gateway-owned abort signal into both catalog fetches, suppress cache writes and scheduling after stop, unref background timers, and add focused lifecycle coverage plus a changelog entry.
Do we have a high-confidence way to reproduce the issue?
Yes. The issue has concrete released-package steps, and current main has a source-level reproduction path: start a pricing refresh with hanging fetches, call the stop callback while it is in flight, then assert the fetches abort and no post-stop timer/cache mutation occurs.
Is this the best way to solve the issue?
No. Current main is a partial mitigation, and the closed timeout/opt-out PR did not address the remaining lifecycle gap; the narrow maintainable fix is cancellation and stop guarding in the existing pricing refresh path.
Acceptance criteria:
pnpm test src/gateway/model-pricing-cache.test.ts src/gateway/server-runtime-services.test.ts src/gateway/server-close.test.ts
pnpm check:changed in Testbox before maintainer handoff if runtime code changes
What I checked:
Reported behavior: The issue gives concrete released-package steps for openclaw@2026.4.24 on Windows 11: openclaw gateway waits for pricing fetch timeouts, the dashboard is unreachable, and Ctrl+C does not exit; another user confirmed the symptom in comments.
Pricing fetches use only per-request timeout signals: Both LiteLLM and OpenRouter catalog fetches pass AbortSignal.timeout(FETCH_TIMEOUT_MS) directly, with no Gateway-owned stop signal that can abort in-flight work. (src/gateway/model-pricing-cache.ts:335, 0a798af4fc7a)
Stop callback does not cancel an active refresh:startGatewayModelPricingRefresh only prevents the queued microtask from starting and clears the shared timer; after refreshGatewayModelPricingCache starts, the returned stop callback has no abort controller or post-stop guard. (src/gateway/model-pricing-cache.ts:1262, 0a798af4fc7a)
Refresh completion can schedule more work:scheduleRefresh creates the 24-hour timeout without unref or a stopped/lifecycle check, and refresh completion paths call it after failures and after cache replacement. (src/gateway/model-pricing-cache.ts:1067, 0a798af4fc7a)
Gateway shutdown seam exists: Gateway close already calls stopModelPricingRefresh, so the remaining repair can stay localized to model-pricing lifecycle behavior instead of broad shutdown plumbing. (src/gateway/server-close.ts:156, 0a798af4fc7a)
Existing tests cover mitigations but not in-flight stop: Current tests cover deferred bootstrap and disabled pricing, while the focused search found no test that stops a running pricing refresh and asserts fetch abort/no post-stop scheduling. (src/gateway/model-pricing-cache.test.ts:733, 0a798af4fc7a)
Likely related people:
shakkernerd: Current blame for the central model-pricing and runtime-service files points to Shakker, and the changelog credits @shakkernerd for the recent plugin-manifest reuse work that partially mitigated pricing startup cost. (role: recent maintainer / pricing hot-path owner; confidence: high; commits: 7641783d6b0e, 7d9dc8cf24fc; files: src/gateway/model-pricing-cache.ts, src/gateway/server-runtime-services.ts, src/gateway/model-pricing-cache.test.ts)
steipete: Peter has recent Gateway runtime scheduling and release-maintenance history around the affected startup/shutdown surface, including deferred scheduled services and latest release commits. (role: gateway runtime maintainer; confidence: medium; commits: 6a7961736a83, a448042c2edd, 0a798af4fc7a; files: src/gateway/server-runtime-services.ts, src/gateway/server-close.ts, CHANGELOG.md)
vincentkoc: Vincent has prior merged work in the Gateway model-pricing cache area and provided current-main verification context in this issue thread. (role: adjacent pricing/cache maintainer; confidence: medium; commits: 2592eb0796dd; files: src/gateway/model-pricing-cache.ts, src/gateway/model-pricing-cache.test.ts)
Remaining risk / open question:
The original dashboard-inaccessible startup symptom may be partly mitigated in current releases, so the follow-up should stay scoped to pricing refresh lifecycle cancellation and not reopen broader startup sequencing without new evidence.
A final fix still needs live or targeted regression proof that stopping Gateway aborts in-flight pricing fetches and leaves no timer that keeps the process alive.
Codex review notes: model gpt-5.5, reasoning high; reviewed against 0a798af4fc7a.
This issue has been resolved in commit 7d9dc8cf24 — fix: reuse plugin manifests for model pricing refresh.
The fix prevents gateway hang on startup when LiteLLM/OpenRouter pricing fetch requests timeout by reusing already-loaded plugin manifest metadata instead of rebuilding it during each pricing refresh.
A backport PR will be opened shortly to include this fix in the next patch release.
Closing this because the remaining shutdown-lifecycle part is fixed on current main and covered by focused regression proof now.
The old review was correct at the time: the first startup mitigation did not yet abort an in-flight pricing refresh. Current main now does that directly: pricing fetches compose the Gateway stop signal with their timeout signal, startGatewayModelPricingRefresh() aborts that controller on stop, and the refresh path skips post-stop cache writes and timer scheduling. The Gateway close path already calls stopModelPricingRefresh().
I also re-ran the focused regression locally:
pnpm test src/gateway/model-pricing-cache.test.ts -- -t "aborts in-flight bootstrap pricing fetches after stop"
Result: 1 passed | 18 skipped.
There are broader pricing follow-ups still open, but they are not the same Ctrl+C / shutdown hang from this issue. The stable package is being cut today, so this should be covered by the next public release. If the new stable still hangs in this startup/shutdown shape, please comment with the updated version and current Gateway logs and we can reopen with a fresh repro.
Activity
clawsweeper commentedon Apr 26, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.
Summary
Keep open. Current main still has pricing-startup mitigations, but the model-pricing refresh remains timeout-only and is not fully tied to Gateway shutdown, so the Ctrl+C/hanging-lifecycle part of the report is still actionable.
Reproducibility: yes. The issue has concrete released-package steps, and current main has a source-level reproduction path: start a pricing refresh with hanging fetches, call the stop callback while it is in flight, then assert the fetches abort and no post-stop timer/cache mutation occurs.
Next step
This is a narrow runtime lifecycle repair with clear files and focused tests; it does not require product or security review first.
Review details
Best possible solution:
Keep the existing startup mitigations, then make model-pricing refresh stop-aware: compose a Gateway-owned abort signal into both catalog fetches, suppress cache writes and scheduling after stop, unref background timers, and add focused lifecycle coverage plus a changelog entry.
Do we have a high-confidence way to reproduce the issue?
Yes. The issue has concrete released-package steps, and current main has a source-level reproduction path: start a pricing refresh with hanging fetches, call the stop callback while it is in flight, then assert the fetches abort and no post-stop timer/cache mutation occurs.
Is this the best way to solve the issue?
No. Current main is a partial mitigation, and the closed timeout/opt-out PR did not address the remaining lifecycle gap; the narrow maintainable fix is cancellation and stop guarding in the existing pricing refresh path.
Acceptance criteria:
What I checked:
openclaw gatewaywaits for pricing fetch timeouts, the dashboard is unreachable, and Ctrl+C does not exit; another user confirmed the symptom in comments.AbortSignal.timeout(FETCH_TIMEOUT_MS)directly, with no Gateway-owned stop signal that can abort in-flight work. (src/gateway/model-pricing-cache.ts:335, 0a798af4fc7a)startGatewayModelPricingRefreshonly prevents the queued microtask from starting and clears the shared timer; afterrefreshGatewayModelPricingCachestarts, the returned stop callback has no abort controller or post-stop guard. (src/gateway/model-pricing-cache.ts:1262, 0a798af4fc7a)scheduleRefreshcreates the 24-hour timeout withoutunrefor a stopped/lifecycle check, and refresh completion paths call it after failures and after cache replacement. (src/gateway/model-pricing-cache.ts:1067, 0a798af4fc7a)stopModelPricingRefresh, so the remaining repair can stay localized to model-pricing lifecycle behavior instead of broad shutdown plumbing. (src/gateway/server-close.ts:156, 0a798af4fc7a)src/gateway/model-pricing-cache.test.ts:733, 0a798af4fc7a)Likely related people:
src/gateway/model-pricing-cache.ts,src/gateway/server-runtime-services.ts,src/gateway/model-pricing-cache.test.ts)src/gateway/server-runtime-services.ts,src/gateway/server-close.ts,CHANGELOG.md)src/gateway/model-pricing-cache.ts,src/gateway/model-pricing-cache.test.ts)Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 0a798af4fc7a.
hoholidayx commentedon Apr 26, 2026
mee too
1yihui commentedon Apr 27, 2026
Fix Available
This issue has been resolved in commit
7d9dc8cf24— fix: reuse plugin manifests for model pricing refresh.The fix prevents gateway hang on startup when LiteLLM/OpenRouter pricing fetch requests timeout by reusing already-loaded plugin manifest metadata instead of rebuilding it during each pricing refresh.
A backport PR will be opened shortly to include this fix in the next patch release.
vincentkoc commentedon Apr 27, 2026
Current
mainverification update:mainin 7d9dc8c.mainalso passes the focused regression coverage:pnpm test:serial src/dockerfile.test.ts src/gateway/model-pricing-cache.test.ts src/gateway/server-runtime-services.test.tsfs-safewrites silently fail in Docker with misleading "path is not a regular file under root" whenpython3is not in PATH #72362; it did not carry a runtime fix.Keeping this issue open as the actual release-risk tracker until package/backport or released-artifact verification exists.
steipete commentedon May 3, 2026
Closing this because the remaining shutdown-lifecycle part is fixed on current
mainand covered by focused regression proof now.The old review was correct at the time: the first startup mitigation did not yet abort an in-flight pricing refresh. Current
mainnow does that directly: pricing fetches compose the Gateway stop signal with their timeout signal,startGatewayModelPricingRefresh()aborts that controller on stop, and the refresh path skips post-stop cache writes and timer scheduling. The Gateway close path already callsstopModelPricingRefresh().I also re-ran the focused regression locally:
pnpm test src/gateway/model-pricing-cache.test.ts -- -t "aborts in-flight bootstrap pricing fetches after stop"Result:
1 passed | 18 skipped.There are broader pricing follow-ups still open, but they are not the same Ctrl+C / shutdown hang from this issue. The stable package is being cut today, so this should be covered by the next public release. If the new stable still hangs in this startup/shutdown shape, please comment with the updated version and current Gateway logs and we can reopen with a fresh repro.