Skip to content

[Bug]: Gateway 100% CPU / infinite loop with DeepSeek V4 models on 2026.4.24 #71915

Closed

Description

@ibarraespinosa

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

OpenClaw version: 2026.4.24 (cbcfdf6)
Linux, npm global install
Node version: v22.22.1

"agents": {
"defaults": {
"model": {
"primary": "deepseek/deepseek-v4-flash",
"fallbacks": ["deepseek/deepseek-v4-pro", ...]
}
}
}

openclaw-gateway process immediately pegs at 100% CPU on startup

Memory consumption grows quickly (30+ GB VIRT, ~1.3 GB RES in minutes)

Occurs even after completely clean reinstall (npm uninstall -g, remove all files, npm cache clean --force, fresh npm install -g openclaw@2026.4.24)

Discord connections show clean codes (1000) but gateway still crashes

Reverting to 2026.4.23 with legacy model names (deepseek-chat) works fine

Direct curl tests to Discord API prove tokens are not rate-limited

the bug only appears when deepseek-v4-flash or deepseek-v4-pro is used as the primary model. Using deepseek-chat on the same version works. This isolates it to the new V4 integration code in 2026.4.24.

Steps to reproduce

openclaw_gh.json

Expected behavior

talk with agents in discord

Actual behavior

all CPU used

OpenClaw version

2026.04.24

Operating system

CentOS 8.0.1905 Core

Install method

npm install -g openclaw@2026.4.24

Model

deepseek-v4-pro

Provider / routing chain

openclaw -> discord

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Activity

  1. steipete commented on Apr 26, 2026

    @steipete
    Contributor

    Codex review update: I would not close this one yet from the current evidence.

    What is fixed on main since 2026.4.24:

    What is still missing here:

    • No gateway log excerpt showing the actual loop site.
    • No stack sample/profile from the 100% CPU process.
    • No proof yet that this still reproduces on a build containing the post-2026.4.24 fixes above.
    • The report says DeepSeek V4 is the trigger, while the strongest confirmed 2026.4.24 CPU/event-loop starvation reports were bundled runtime-deps resolver/staging loops. Those may overlap in the same startup window, but the DeepSeek-specific root cause is not proven from this issue alone.

    Useful next evidence if this still reproduces on latest main/next release:

    openclaw --version
    tail -n 300 /tmp/openclaw/openclaw-*.log
    ps -o pid,ppid,pcpu,pmem,command -p <gateway-pid>
    node --cpu-prof --cpu-prof-dir /tmp/openclaw-cpu --inspect=0 # if running from source/repro harness

    Also check whether logs repeat [plugins] ... staging bundled runtime deps or model-pricing refresh lines. If runtime-deps lines repeat, this is a duplicate of the now-fixed #71818 class. If not, we should treat it as a separate DeepSeek V4 startup loop and chase that code path directly.

  2. clawsweeper commented on Apr 29, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.

    Keep open. Current main has several adjacent DeepSeek V4 replay, model-pricing, Gateway startup, and bundled runtime-deps fixes, but the issue still lacks current-main or latest-release logs/profile evidence tying the reported DeepSeek-primary 100% CPU loop to one of those fixed paths.

    Required change / next step:

    This may be a serious Gateway availability bug, but an automated fix PR is not safe until a maintainer or reporter captures current-main/latest-release logs and a CPU profile showing the actual loop site.

    Security review:

    Security review: This is non-PR issue triage with no patch under review; the report is an availability/performance bug rather than a security-sensitive code change.

    Review details

    Best possible solution:

    Keep this open until someone reruns on current main or the latest release and captures the hot loop site. Then fix the narrow owner path: bundled runtime-deps if logs repeat dependency staging, Gateway startup/model-pricing if the stack points there, or DeepSeek V4 payload/replay if the profile is in provider request shaping.

    Do we have a high-confidence way to reproduce the issue?

    No high-confidence current-main reproduction exists. The report has useful version, OS, install method, and model configuration, but it still lacks current-main logs, repeated-loop markers, and a CPU profile or stack sample.

    Is this the best way to solve the issue?

    Unclear. The adjacent fixes are plausible mitigations, but the best maintainable solution is to localize the current hot loop before making another DeepSeek, Gateway startup, model-pricing, or runtime-deps change.

    Acceptance criteria:

    • openclaw --version
    • tail -n 300 /tmp/openclaw/openclaw-*.log while Gateway CPU is pegged
    • ps -o pid,ppid,pcpu,pmem,command -p during the high-CPU window
    • If reproducible from source, collect a Node CPU profile or stack sample for the Gateway process
    • After localization, run the matching targeted checks: pnpm test extensions/deepseek/index.test.ts src/plugin-sdk/provider-stream-shared.test.ts, pnpm test src/plugins/bundled-runtime-deps.test.ts, or pnpm test src/gateway/server-startup-post-attach.test.ts src/gateway/server-startup-plugins.test.ts

    What I checked:

    • Discussion kept the issue open pending localization: The maintainer comment and prior ClawSweeper review both note that this issue lacks Gateway logs, repeated-loop markers, and a CPU profile from a build containing the post-2026.4.24 adjacent fixes.
    • DeepSeek V4 replay handling exists on current main: Current main wraps DeepSeek V4 OpenAI-compatible payloads, enables/disables thinking, maps reasoning effort, strips reasoning_content when thinking is off, and backfills missing assistant reasoning_content when thinking is enabled. (src/plugin-sdk/provider-stream-shared.ts:280, 068b33de8717)
    • DeepSeek plugin scopes the wrapper to V4 models: The DeepSeek provider registers OpenAI-compatible replay hooks and wraps only the V4 model set deepseek-v4-flash and deepseek-v4-pro. (extensions/deepseek/index.ts:63, 068b33de8717)
    • Tests cover DeepSeek V4 payload shape, not the reported hot loop: Current tests assert thinking-level mapping, reasoning_content preservation/backfill/strip behavior, and SDK-level assistant-message backfill, but they do not reproduce Gateway startup CPU or memory growth. (extensions/deepseek/index.test.ts:144, 068b33de8717)
    • Runtime-deps nested-root loop class is adjacent but not proven here: Current main reuses enclosing external openclaw-* stage roots instead of deriving nested openclaw-unknown-* roots, and regression coverage asserts the nested root does not reinstall. The issue does not include the runtime-deps log markers needed to identify this as the same root cause. (src/plugins/bundled-runtime-deps-roots.ts:327, 068b33de8717)
    • Changelog records the runtime-deps ENOTEMPTY loop fix separately: The changelog says fix(bundled-runtime-deps): collapse nested cache pluginRoot to enclosing key (Fixes #72956) #73205 fixes the nested staged-path runtime-deps loop that minted openclaw-unknown-* directories and looped on ENOTEMPTY, but this issue has not shown that signature. (CHANGELOG.md:643, 068b33de8717)

    Likely related people:

    • steipete: Provided the maintainer triage on this issue, authored adjacent DeepSeek V4 proxy/replay and model-pricing startup fixes, and current-main blame for the relevant DeepSeek wrapper and Gateway/runtime-deps files points through recent maintainer work. (role: maintainer reviewer and recent adjacent maintainer; confidence: high; commits: 31456e3326bb, a5a438a17c90, 068b33de8717; files: src/plugin-sdk/provider-stream-shared.ts, extensions/deepseek/index.ts, src/gateway/model-pricing-cache.ts)
    • SymbolStar: Merged PR fix(bundled-runtime-deps): collapse nested cache pluginRoot to enclosing key (Fixes #72956) #73205 is the closest known runtime-deps loop fix: it collapses nested staged plugin roots back to the enclosing versioned cache and is recorded in the changelog as fixing the openclaw-unknown-* ENOTEMPTY loop class. (role: adjacent runtime-deps fix author; confidence: medium; commits: fc9772ae222b; files: src/plugins/bundled-runtime-deps-roots.ts, src/plugins/bundled-runtime-deps.test.ts, CHANGELOG.md)
    • lsdsjy: The 2026.4.24 changelog credits this person for adding DeepSeek V4 Flash/Pro to the bundled catalog and making V4 Flash the onboarding default, which is the new model surface named in the report. (role: introduced DeepSeek V4 surface; confidence: medium; files: CHANGELOG.md, extensions/deepseek/openclaw.plugin.json, extensions/deepseek/onboard.ts)
    • Tak Hoffman: Authored earlier bundled runtime-deps staging work that is adjacent to the package/runtime-deps class discussed as a possible overlap with this report. (role: adjacent runtime-deps staging contributor; confidence: low; commits: 04d01984efae; files: scripts/stage-bundled-plugin-runtime-deps.mjs, test/scripts/stage-bundled-plugin-runtime-deps.test.ts)

    Remaining risk / open question:

    • The original report may still be a distinct DeepSeek V4 provider/startup loop because no current-main Gateway log or CPU profile identifies the hot code path.
    • Adjacent runtime-deps fixes may explain the 2026.4.24 symptoms, but the issue lacks the repeated runtime-deps staging lines needed to close it as that fixed class.
    • The open test-only PR protects one payload-shape path but does not validate production Gateway CPU or memory behavior.

    Codex review notes: model gpt-5.5, reasoning high; reviewed against 068b33de8717.

  3. steipete commented on May 1, 2026

    @steipete
    Contributor

    Closing this old 2026.4.24 report as superseded by current main pending a fresh repro.

    Several adjacent causes changed after this was filed: the old bundled runtime-deps loop/starvation class is gone, plugin dependency work is install/update-time, startup/reload do not run package-manager repair, packaged JavaScript plugin surfaces prefer native import/require over Jiti, and DeepSeek/provider startup paths have had follow-up fixes since 2026.4.24.

    If DeepSeek V4 still pins the gateway on 2026.5.x or current main, please reopen with the exact version plus a gateway log excerpt and a CPU sample/profile showing the actual loop site. Without that, this older report is more likely to keep sending us back into paths that no longer exist.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions