Skip to content

[Bug]: 4.24版本全局安装后卡死,无法使用 #72208

Closed

Description

@rzcq

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

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.

Steps to reproduce

  1. npm install -g openclaw@2026.4.24
  2. openclaw gateway
  3. Wait for pricing fetch timeout (~30s each)
  4. Process hangs, dashboard at http://127.0.0.1:18789/ unreachable

Expected behavior

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.

OpenClaw version

2026.4.24

Operating system

windows11

Install method

npm global

Model

openrouter/openrouter/free

Provider / routing chain

openrouter

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Activity

  1. added
    bugSomething isn't working
    on Apr 26, 2026
  2. clawsweeper commented on Apr 26, 2026

    @clawsweeper
    Contributor

    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 exec oxfmt --check --threads=1 src/gateway/model-pricing-cache.ts src/gateway/model-pricing-cache.test.ts src/gateway/server-runtime-services.ts src/gateway/server-runtime-services.test.ts src/gateway/server-close.ts src/gateway/server-close.test.ts CHANGELOG.md
    • 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.

  3. hoholidayx commented on Apr 26, 2026

    @hoholidayx

    mee too

  4. 1yihui commented on Apr 27, 2026

    @1yihui
    Contributor

    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.

  5. self-assigned this
    on Apr 27, 2026
  6. vincentkoc commented on Apr 27, 2026

    @vincentkoc
    Member

    Current main verification update:

    Keeping this issue open as the actual release-risk tracker until package/backport or released-artifact verification exists.

  7. steipete commented on May 3, 2026

    @steipete
    Contributor

    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.

  8. locked as resolved and limited conversation to collaborators on May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingregressionBehavior that previously worked and now fails

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions