Skip to content

[Bug]: Severe chat latency (30–90s) on Docker VPS while direct OpenAI completes in <1s — OpenClaw 2026.4.26 #73428

Closed

Description

@MojoTheApe

Bug type

Crash (process/app exits or hangs)

Beta release blocker

No

Summary

Every chat turn through OpenClaw WebChat takes 30–90 seconds end-to-end on a 2 vCPU / 4 GB Docker VPS, while the same gpt-4o-mini call from inside the same container via curl returns in 0.83–1.73 seconds.

Steps to reproduce

  1. Deploy ghcr.io/openclaw/openclaw:2026.4.26 on Ubuntu 24.04 VPS (2 vCPU / 4 GB) via Docker Compose.
  2. Configure with OpenAI provider and gpt-4o-mini as primary model. Disable bonjour, browser, phone-control, talk-voice, acpx in plugins.entries. Leave openai and memory-core enabled.
  3. Open Control UI, wait for connection (chat.history and models.list complete in ~1.3s after Caddy WebSocket fix).
  4. Send the message: "What is 7+7?"
  5. Measure time from Send to full reply.
  6. From inside the same container, run curl directly to https://api.openai.com/v1/chat/completions with the same prompt and same model.
  7. Compare both timings.

Expected behavior

Direct OpenAI baseline from inside the same container, same model, same prompt:
Run 1: 1.73s HTTP:200
Run 2: 0.83s HTTP:200
Run 3: 0.87s HTTP:200
Median: ~0.87s

Expected: chat turn through OpenClaw should complete within a small multiple of the underlying model call (a few seconds of orchestration overhead is reasonable).

Actual behavior

Measured chat turns through OpenClaw WebChat (Control UI v2026.4.26):
"2+2" A=immediate, B=34s
"5+5" A=immediate, B=36s
"7+7" A=immediate, B>60s, sometimes never completes
"hi" A=immediate, B=36s
"who are you?" A=immediate, B=47s

Where A = time to first response chunk, B = time to full reply.

Recurring diagnostic in gateway logs during these turns:
[diagnostic] stuck session: sessionId=unknown sessionKey=agent:main:main state=processing age=216s queueDepth=1

During the wait, the gateway main process state via /proc:
state: S (sleeping)
wchan: ep_poll
syscall: 281 (epoll_pwait)
I/O counter delta over 5s: rchar=0, wchar=0, read_bytes=0, write_bytes=0

So the gateway is not CPU-bound, not disk-bound, not in a busy loop — it appears to be sleeping in epoll_wait while the chat turn is reported as "processing" with queueDepth=1.

OpenClaw version

2026.4.26

Operating system

Ubuntu 24.04.3 LTS, kernel 6.8.0-110-generic

Install method

docker (ghcr.io/openclaw/openclaw image via Docker Compose v5.1.3 / Docker 29.4.0)

Model

openai/gpt-4o-mini (also tested openai/gpt-4.1-mini — no measurable improvement)

Provider / routing chain

openclaw -> openai (direct, https://api.openai.com/v1) No proxies, no routers, no LiteLLM, no OpenRouter.

Additional provider/model setup details

Representative chat-turn log timeline:

00:10:49 webchat connected
00:10:51 commands.list ✓ 1054ms
00:10:52 device.pair.list ✓ 1753ms
00:10:52 node.list ✓ 1763ms
00:12:02 node.list ✓ 27161ms
00:13:33 chat.history ✓ 163489ms (before Caddy WS fix)
00:13:33 models.list ✓ 163478ms
00:15:36 [diagnostic] stuck session: sessionKey=agent:main:main state=processing age=216s queueDepth=1

After Caddy WebSocket transport tuning (read_timeout 1h, flush_interval -1):
chat.history: 163s -> 1.3s
models.list: 163s -> 1.3s
But agent-turn latency unchanged (still 30-90s).

Direct OpenAI baseline from inside container:
Run 1: 1.73s HTTP:200
Run 2: 0.83s HTTP:200
Run 3: 0.87s HTTP:200

Process state during a stuck turn (cat /proc//{wchan,status,syscall,stack,io}):
state: S (sleeping)
wchan: ep_poll
syscall 281 (epoll_pwait)
I/O counters over 5s: 0 byte delta on rchar/wchar/read_bytes/write_bytes

Open file descriptors during turn: runs.sqlite{,-wal,-shm}, gateway lock, eventfds, eventpolls. No suspicious activity.

Things attempted that did NOT resolve latency (only the first two affected behavior visibly):

  1. Disabled Bonjour via plugins.entries.bonjour.enabled=false (reduced startup noise, did not affect chat latency)
  2. Caddy WebSocket transport tuning (fixed UI bootstrap from 163s -> 1.3s, did not affect chat latency)
  3. Cleared plugin-runtime-deps cache (843MB -> 0, regenerated to 634MB on next start, no effect on chat latency)
  4. Blocked OpenRouter / LiteLLM via extra_hosts (pricing fetches fail in <50ms now, no effect on chat)
  5. Upgraded 2026.4.25 -> 2026.4.26 (fixed UI history-loss bug, did not fix chat latency)
  6. Tested via direct SSH tunnel bypassing Caddy entirely (same latency, so Caddy is not the cause)
  7. Disabled all bundled plugins except openai and memory-core
  8. Set mem_limit=1.5G, healthcheck start_period=200s
  9. Multiple full restarts and fresh state attempts
  10. Switched gpt-4o-mini -> gpt-4.1-mini (no measurable change)
  11. Workspace bootstrap files simplified (AGENTS.md 7850 -> 251 bytes, HEARTBEAT.md emptied) — no effect on latency, but agent lost personality (read BOOTSTRAP.md and ran first-run dialogue), so reverted.

Cold-start time: 130–150s consistently. Acceptable; not the issue.

Resource state during the issue:
Memory: 3.8 GiB total, 2.7 GiB available
Swap: 2.0 GiB total, ~100 MiB used
CPU idle: ~95%
Container memory: ~600 MB
Disk: 32% used of 77 GB

Logs, screenshots, and evidence

Impact and severity

Affected: Single-user self-hosted setup (personal AI assistant on small Docker VPS). Likely affects any small-VPS Docker deployment based on observed pattern.

Severity: High for interactive chat use case. System is technically functional (messages eventually arrive) but unusable as a real-time assistant given 30–90s per turn.

Frequency: Every single chat turn, including trivial single-token replies. 100% reproducible.

Consequence: OpenClaw cannot serve as an interactive chat companion in this configuration. Direct OpenAI usage and a co-hosted n8n agent on the same VPS both perform fast, so the VPS itself is not the bottleneck.

Additional information

Both 2026.4.25 and 2026.4.26 exhibit the same latency. 4.26 fixed the unrelated UI history-loss bug (chat history disappearing on reload — confirmed fixed).

Open questions for maintainers:

  1. What tracing or debug envs would help pinpoint where time is spent inside an agent turn?
  2. Is there a way to disable memory-core entirely on a fresh install? It's default-enabled and not in the usual config flow.
  3. Could OPENCLAW_DISABLE_PERSISTED_PLUGIN_REGISTRY=1 (mentioned in release notes as a deprecated break-glass) help here?
  4. Are there documented tunables for the agent runtime queue / session manager?

Happy to provide more logs, run tracing patches, or test fixes.

Activity

  1. clawsweeper commented on Apr 28, 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 useful diagnostics and another narrow runtime-deps performance slice, but the latest issue discussion reproduces the latency on v2026.4.29 and points to several remaining pre-model stages rather than a fully fixed path.

    Required change / next step:

    Needs maintainer-guided affected-install retesting and profiling before a safe automated fix PR; current evidence is valid but not narrowed to one confirmed code hotspot on current main.

    Security review:

    Security review: No PR diff is under review, and this is an ordinary performance/latency issue rather than a security-sensitive report.

    Review details

    Best possible solution:

    Keep this as the active Docker/WebChat agent-prep latency tracker, retest current main or the next package with trace-level embedded-run logs and /readyz event-loop diagnostics, then fix the single stage that dominates on the affected install.

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

    Yes for released builds: the original report gives concrete Docker/WebChat steps on v2026.4.26, and a later comment reproduces a similar Docker/VPS stall on v2026.4.29. Current main reproduction remains unconfirmed after the latest 3c48510 runtime-deps change.

    Is this the best way to solve the issue?

    No final solution is proven yet. The current patches are useful diagnostics and partial runtime-deps reductions, but the safest maintainable fix is a stage-specific change after current-main trace data shows whether model resolution, auth, tool construction, system-prompt work, or stream setup is still dominant.

    Acceptance criteria:

    • Retest an affected Docker/VPS install on current main or the next package with OPENCLAW_LOG_LEVEL=trace.
    • Capture [trace:embedded-run] startup/prep summaries for cold and warm turns.
    • Capture /readyz detailed eventLoop diagnostics during the slow window.
    • After a targeted fix, run the focused tests for the touched stage, likely pnpm test src/agents/pi-embedded-runner/run/attempt-stage-timing.test.ts and any touched src/plugins or src/config tests.

    What I checked:

    • Fresh current-release reproduction: A 2026-04-30 issue comment reports a separate Docker/VPS install on v2026.4.29 still seeing 40-70s active-run stalls, /healthz timeouts, eventLoopUtilization=1, and slow model-resolution, auth, core-plugin-tools, system-prompt, and stream-setup stages.
    • WebChat still acknowledges before async dispatch: chat.send responds with status started before dispatchInboundMessage is launched asynchronously, so the reported immediate acknowledgement followed by a delayed full reply still matches current main behavior. (src/gateway/server-methods/chat.ts:2059, 3c4851037b6c)
    • Startup diagnostics cover the reported slow stages: runEmbeddedPiAgent marks model-resolution and auth stages before attempt dispatch, matching the latest report's slow pre-run timing names but serving as instrumentation rather than proof of a completed fix. (src/agents/pi-embedded-runner/run.ts:471, 3c4851037b6c)
    • Prep diagnostics cover core-plugin-tools and stream-setup: runEmbeddedAttempt marks core-plugin-tools and stream-setup before emitting the stream-ready stage summary, matching two of the remaining slow stages in the v2026.4.29 reproduction. (src/agents/pi-embedded-runner/run/attempt.ts:775, 3c4851037b6c)
    • Latest main only narrows one runtime-deps slice: Commit 3c48510 adds an early return when requested package-level runtime deps are already materialized, avoiding broader manifest scans for that case; the regression test asserts the unrelated bundled manifest is not read. (src/plugins/bundled-runtime-deps.ts:387, 3c4851037b6c)
    • Latest fix is main-only so far: v2026.4.29 points at a448042, while git tag --contains 3c48510 produced no release tags and git branch --contains lists only main/origin/main. (3c4851037b6c)

    Likely related people:

    • steipete: Peter commented on and landed the runtime-deps and embedded-run diagnostic slices tied to this issue, and authored the latest current-main runtime-deps manifest-scan optimization. (role: recent maintainer and latency-path fixer; confidence: high; commits: 3c4851037b6c, 90419df6633f, 1a2228d29151; files: src/plugins/bundled-runtime-deps.ts, src/plugins/bundled-runtime-deps.test.ts, src/agents/pi-embedded-runner/run.ts)
    • vincentkoc: Vincent has recent runtime-deps and agent/runtime transport work adjacent to the remaining stages, including the runtime-deps reinstall-loop coverage and many related agent/gateway reliability entries in the current changelog. (role: adjacent runtime and agent maintainer; confidence: medium; commits: e311ffdcb94e; files: src/plugins/bundled-runtime-deps.test.ts, CHANGELOG.md)
    • pashpashpash: Nik recently touched the embedded runner for Codex app-server state isolation, which is adjacent to the harness/runtime path but less directly tied to the OpenAI Docker/WebChat latency evidence. (role: adjacent agent harness maintainer; confidence: low; commits: 027ea5f08bd9; files: src/agents/pi-embedded-runner/run.ts)

    Remaining risk / open question:

    • No affected Docker/VPS install has retested current main after 3c48510, so the latest runtime-deps fast path may reduce pressure without resolving the whole issue.
    • The newest timings identify multiple slow stages, so a repair PR would be guessing without another current-main trace that isolates the dominant remaining hotspot.

    Codex review notes: model gpt-5.5, reasoning high; reviewed against 3c4851037b6c.

  2. quangtran88 commented on Apr 28, 2026

    @quangtran88
    Contributor

    Adding fresh data on v2026.4.26 + answering @clawsweeper's ask for transport: "sse" / openaiWsWarmup: false timings.

    Setup

    • Image: ghcr.io/openclaw/openclaw:2026.4.26
    • Provider: openai direct (https://api.openai.com/v1), model openai/gpt-5.4
    • Channels: slack-multiuser + telegram-multiuser (4 in-repo plugins: composio, multiagent, onething, phoenix, tool-compact)
    • Container on macOS Docker Desktop, native build

    Symptom Reproduced

    Run Total Embedded run start gap streamFn wrapper gap Actual LLM Notes
    Cold (first message after gateway boot) 120s 49s after dispatch 62s after embedded run start 8s gpt-5.4
    Warm (second message, same session) 19s 0.7s still ~11s 3.4s gpt-5.4
    Warm (slack channel) 60s 41s 11s 3.5s first slack turn after boot

    So we see two distinct contributors:

    1. One-time cold startup: ~41s gap between dispatch and embedded run start on the FIRST message per gateway process. Goes to 0.7s on the second message — pi-ai SDK/runtime is being lazily warmed.
    2. Per-run floor of ~11s between embedded run start and creating streamFn wrapper, observed on EVERY message (including warm). Logs show 4× plugin tool factory returned null (oneclaw-multiagent): [telegram_*] immediately before the wrapper line, but the factory calls themselves are millisecond-cheap. The 11s is the cumulative cost of bootstrap context, MCP/LSP runtime creation, system-prompt assembly (14,369 chars in our case), and provider config — across attempt.ts lines 583–1551 (research/openclaw/repo/src/agents/pi-embedded-runner/run/attempt.ts).

    On the transport: "sse" / openaiWsWarmup: false ask

    We tried the documented overrides per docs/concepts/model-providers.md:88:

    {
      "agents": {
        "defaults": {
          "models": {
            "openai/gpt-5.4": { "params": { "transport": "sse", "openaiWsWarmup": false } }
          }
        }
      }
    }
    

    and the simpler global form:

    { "agents": { "defaults": { "params": { "transport": "sse", "openaiWsWarmup": false } } } }
    

    Both get stripped from openclaw.json on disk ~13s after gateway start. We verified:

    • generate-config.mjs writes the field (confirmed via node /app/generate-config.mjs /tmp/test.json inside the container — field present)
    • Live openclaw.json mtime advances 13s after container start — gateway is rewriting it
    • Final disk content has neither agents.defaults.params nor agents.defaults.models["openai/gpt-5.4"].params
    • AgentDefaultsSchema (src/config/zod-schema.agent-defaults.ts:43) accepts both shapes via .strict() with params: z.record(z.string(), z.unknown())
    • applyModelAliasDefaults (src/config/defaults.ts:255) appears to preserve params in-memory

    So the override path documented in model-providers.md:88 is non-functional in v2026.4.26 — the runtime persist/reload cycle drops the field before extra-params.ts reads it. From our logs, creating streamFn wrapper with params: {"transport":"auto","openaiWsWarmup":false} confirms transport=auto is what reaches the wrapper, regardless of what we put in the file.

    We did NOT find an env-var override (OPENCLAW_*TRANSPORT* doesn't exist in the agents/ tree), so we couldn't validate the SSE-only path on this image without patching upstream.

    What's working in v2026.4.26 on our side

    • Phoenix agent:bootstrap registerHook with name option ✓
    • multiagent channelConfigs for 5 channels ✓
    • allowConversationAccess for typed conversation hooks (multiagent agent_end, phoenix llm_input/llm_output) ✓
    • typebox v1 migration (15 tool files) ✓
    • F1/F2/F3 runtime regressions cleared

    Eager init noise (orthogonal — not new)

    Boot logs show:

    [plugins] [oneclaw-multiagent] Eager init failed (gateway_start will retry): TypeError: Cannot read properties of undefined (reading 'error')
    [plugins] [oneclaw-multiagent] Eager init: 11 users + 8 channels loaded
    

    Race in our plugin's getPluginRuntime() deref before SDK store hydrates. Pre-existing on our side, retry succeeds, not introduced by v26 — flagging only because it appears in the same boot window.

    Asks

    1. Is the agents.defaults.params / agents.defaults.models[].params strip a known regression in v26's persist/reload, or is the documented override path expected to use a different shape?
    2. Is the per-run 11s in the bootstrap → MCP/LSP → system-prompt → streamFn chain on the radar (related to Cold-Load Bottleneck in tools --help / effective / status --usage (2026.4.23) #73477)? Happy to file a separate issue with finer-grained timestamps if useful.
    3. Is there an env-var or --flag override for transport/openaiWsWarmup we missed?

    I can post finer-grained attempt.ts timestamps from a debug-logging build if it would help isolate which sub-step in 583–1551 dominates the 11s.

  3. Heyvhuang commented on Apr 28, 2026

    @Heyvhuang

    I can reproduce the high pre-run latency on v2026.4.26, but I do not see the same issue on the v2026.4.14 line.

    The important difference is that v2026.4.14 still has tools available and callable in my test environment. This does not look like a “no tools enabled” comparison.

    On v2026.4.26, the main delay does not appear to be the model call itself. In repeated short-message tests, the slow section is consistently before run_started.

    Approximate breakdown:

    v2026.4.26 Run A:
    total: ~27s
    message queued -> lane dequeue: ~3.6s
    lane dequeue -> run_started: ~19.4s
    run_started -> completed: ~4.2s
    
    v2026.4.26 Run B, after setting message queue/inbound debounce to 0:
    total: ~21s
    message queued -> lane dequeue: ~1.2s
    lane dequeue -> run_started: ~15.3s
    run_started -> completed: ~4.1s
    
    v2026.4.26 Run C, with one nonessential diagnostic path disabled:
    total: ~19s
    message queued -> lane dequeue: ~1.1s
    lane dequeue -> run_started: ~13.8s
    run_started -> completed: ~4.4s
    
  4. steipete commented on Apr 29, 2026

    @steipete
    Contributor

    Landed a narrow runtime-deps latency slice on main: 234cbf5 (perf(plugins): memoize packaged runtime dist mirrors).

    What changed:

    • src/plugins/bundled-runtime-dist-mirror-cache.ts adds a per-process memo for packaged bundled dist-mirror preparation.
    • src/plugins/loader.ts and src/plugins/bundled-runtime-root.ts now skip repeat root dist/ mirror scans once a packaged mirror has been prepared, while still refreshing plugin roots and leaving source-checkout mirrors uncached.
    • src/plugins/bundled-runtime-root.test.ts covers the packaged cache and source-checkout escape hatch.

    Validation:

    • Local: pnpm test src/plugins/bundled-runtime-root.test.ts src/plugins/bundled-runtime-deps.test.ts passed, 99 tests.
    • Local: pnpm test src/plugins/loader.test.ts -- -t "materializes root JavaScript chunks in external runtime mirrors" passed.
    • Local: targeted oxfmt --check and git diff --check passed.
    • Blacksmith Testbox tbx_01kqcj2cgth1b3219amqadnmjk: OPENCLAW_TESTBOX=1 pnpm check:changed passed across core/coreTests/docs lanes.

    Not closing this yet. This removes another repeated pre-turn packaged-loader scan that matches the event-loop-starvation cluster, but affected Docker/VPS installs should retest current main or the next package before we call #73428 fully fixed.

  5. steipete commented on Apr 29, 2026

    @steipete
    Contributor

    Landed another narrow diagnostic slice on main: 20e2117 (fix(agents): trace slow embedded run startup stages).

    What changed:

    • runEmbeddedPiAgent now emits an embedded-run startup stage summary before dispatching the attempt, covering workspace resolution, runtime plugin loading, hooks, model resolution, auth, context engine setup, and attempt dispatch.
    • runEmbeddedAttempt now emits a prep-stage summary before model I/O / stream wrapping, covering workspace+sandbox, skills, core/plugin tools, bootstrap context, bundled MCP/LSP tools, system prompt build, session/resource loader, agent session creation, and stream setup.
    • Normal runs only log the summary at debug level; it is promoted to warn when total prep is >=2s or any single stage is >=1s.

    Validation:

    • Local: pnpm test src/agents/pi-embedded-runner/run/attempt-stage-timing.test.ts
    • Local: targeted oxfmt --check and git diff --check
    • Blacksmith Testbox on commit 20e21173: OPENCLAW_TESTBOX=1 pnpm check:changed --base HEAD~1 --head HEAD selected core, coreTests, docs and passed.

    Keeping this open. This does not claim the full Docker/VPS latency regression is fixed yet; it should make the next v2026.4.27+ repro identify whether the remaining pre-model time is in plugin loading, auth/model resolution, tool inventory, bootstrap, bundled MCP/LSP, resource loading, or stream setup.

  6. steipete commented on Apr 29, 2026

    @steipete
    Contributor

    Follow-up on the diagnostic logging behavior: main now includes 66cdbcc (fix(agents): demote embedded run stage logs to trace) plus 03e17d1 (test(plugins): avoid map spread in provider fixture).

    The stage summaries are now [trace:embedded-run] trace-level lines for normal support captures. They only promote to warn for severe cases: total startup/prep >=10s or a single stage >=5s. That keeps normal gateway logs quiet while still making the #73428 repro path easy to grep when OPENCLAW_LOG_LEVEL=trace is enabled.

    Validation on Blacksmith Testbox for 03e17d19: OPENCLAW_TESTBOX=1 pnpm check:changed --base HEAD~2 --head HEAD selected core, coreTests, docs and passed.

  7. crash2kx commented on Apr 30, 2026

    @crash2kx

    I can reproduce a very similar issue on a separate Docker/VPS install after updating to 2026.4.29.

    This no longer looks Telegram-specific. It reproduces both from Telegram and from Control UI/WebChat:

    • OpenClaw: 2026.4.29
    • Install: Docker compose on Ubuntu VPS
    • Gateway process stays alive and eventually recovers
    • During each agent turn, gateway CPU jumps to ~100% for roughly 40-70s
    • /healthz times out during the spike, then returns HTTP 200 afterward
    • Telegram shows typing, then pauses, then the answer arrives late
    • Control UI message shows the same behavior, so Telegram transport is not the root cause
    • The actual model call is short; the delay is before/around agent preparation

    Representative timings from the updated install:

    Telegram run:
    attempt-dispatch totalMs=30272
      model-resolution=16295ms
      auth=7311ms
      attempt-dispatch=6661ms
    
    stream-ready totalMs=43193
      core-plugin-tools=19378ms
      bootstrap-context=1631ms
      bundle-tools=2074ms
      system-prompt=7625ms
      session-resource-loader=2189ms
      stream-setup=10231ms
    
    liveness warning:
    eventLoopDelayP99Ms=19394.5
    eventLoopUtilization=1
    cpuCoreRatio=1.063
    

    A Control UI/WebChat run showed almost the same shape:

    attempt-dispatch totalMs=26191
      model-resolution=13962ms
      auth=7115ms
      attempt-dispatch=5106ms
    
    stream-ready totalMs=39767
      core-plugin-tools=19466ms
      bootstrap-context=411ms
      bundle-tools=1626ms
      system-prompt=6996ms
      session-resource-loader=1857ms
      stream-setup=9269ms
    

    The trajectory for the same Control UI run showed the model itself was not slow:

    session.started -> context.compiled: ~12.7s
    model.completed: ~4.3s after prompt submission
    

    So 2026.4.29 appears to have improved/fixed the earlier repeated filesystem/plugin materialization issue reported in #74240, but a separate per-turn agent-prep/main-thread blocking problem remains. The most suspicious repeated stages are core-plugin-tools, model-resolution, auth, and stream-setup.

    Happy to run a specific trace or debug flag if maintainers can point to the best instrumentation.

  8. Heyvhuang commented on May 1, 2026

    @Heyvhuang

    Adding one more data point: I agree with the observation above that this does not look Telegram-specific.

    I tested a separate Docker/VPS-hosted instance with 2026.4.29-slim, and the same regression reproduces from Control UI/WebChat as well. So the delay appears to be inside the Gateway / agent preparation path, not in the Telegram transport.

    Environment:

    • OpenClaw: 2026.4.29-slim
    • Image: ghcr.io/openclaw/openclaw:2026.4.29-slim
    • Install: Docker on VPS
    • Transport tested: Control UI / WebChat
    • Gateway remains alive and eventually recovers

    Representative WebChat timeline:

    webchat connected
    chat.history 416ms
    commands.list 604ms
    node.list 854ms
    
    sessions.list 16746ms
    models.list 51087ms
    

    During the same window, the gateway emitted:

    [diagnostic] liveness warning:
    eventLoopDelayP99Ms=32614.9
    eventLoopDelayMaxMs=32614.9
    eventLoopUtilization=1
    cpuCoreRatio=0.504
    active=1
    waiting=0
    queued=1
    

    The agent turn trace showed the delay before streaming/model output:

    startup stages:
    totalMs=25554
    model-resolution=5350ms
    auth=11059ms
    attempt-dispatch=9142ms
    
    prep stages:
    totalMs=62064
    core-plugin-tools=22162ms
    bundle-tools=4442ms
    system-prompt=17021ms
    session-resource-loader=2547ms
    stream-setup=15863ms
    

    After the spike, the gateway recovered and later websocket calls were fast again:

    sessions.list 190ms
    node.list 197ms
    sessions.list 245ms
    

    So this looks like the same per-turn Gateway / agent-prep main-thread blocking issue described above. The most suspicious repeated stages from my run are core-plugin-tools, auth, system-prompt, stream-setup, and models.list.

    Happy to test a patched image or run any debug flag that would help narrow this down.

  9. timxx commented on May 1, 2026

    @timxx

    I have the same problem on Arch Linux (not VPS), even with a refresh install, the chat response is delay too much:

    09:18:46+00:00 warn diagnostic {"subsystem":"diagnostic"} liveness warning: reasons=event_loop_delay interval=33s eventLoopDelayP99Ms=20.4 eventLoopDelayMaxMs=6929 eventLoopUtilization=0.257 cpuCoreRatio=0.269 active=1 waiting=0 queued=1
    09:18:49+00:00 info gateway/ws {"subsystem":"gateway/ws"} ? res ? node.list 3046ms conn=1114bf10?229c id=1b1d7b32?7903
    
  10. steipete commented on May 1, 2026

    @steipete
    Contributor

    Rechecked against current origin/main (666ab0a00b). Keeping this open.

    What is fixed or improved on main:

    • Several runtime-deps hot-path slices have landed, including 29ed5266bf (fix: keep runtime deps repair out of hot paths), plus provider/runtime hook caching (354084b1b3) and related plugin-runtime reductions.
    • The specific OpenAI transport override complaint from the v2026.4.26 follow-up is at least partially addressed by b68f3de91b (fix(agent): honor explicit OpenAI SSE transport).
    • fix(gateway): resolve tools.effective cold misses synchronously #73540 was investigated for tools.effective, but closed because it mostly moved work around rather than materially fixing this issue.

    Why this is not closeable yet:

    So #73428 should stay as the umbrella Docker/WebChat latency tracker until a current-main/package retest shows the full 30-90s pre-model delay is gone. The next useful proof is another affected install on a build containing 666ab0a00b or newer with [trace:embedded-run] startup/prep stage lines.

  11. steipete commented on May 1, 2026

    @steipete
    Contributor

    Closing this out now: current main contains multiple latency/runtime hot-path fixes since the original report, and the remaining reports have been split into narrower follow-ups (#75616, #75290, #75329).

    If this exact Docker/WebChat 30-90s latency still reproduces on a build containing current main or the next package with the stage traces enabled, please reopen with the fresh [trace:embedded-run] startup/prep lines so we can chase the remaining bucket directly.

  12. 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