openclaw - ✅(Solved) Fix [Bug] Slow typing in webchat input with keystroke delay [2 pull requests, 1 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#54874Fetched 2026-04-08 01:34:59
View on GitHub
Comments
0
Participants
1
Timeline
9
Reactions
0
Timeline (top)
referenced ×5cross-referenced ×2labeled ×2

Summary Typing in the webchat input box is extremely slow - each keystroke causes a noticeable delay of 500ms-1s before the character appears. This makes typing feel unresponsive.

Root Cause

Root cause appears to be typing detection mechanism in webchat UI. Disabling reasoning/verbose partially helps.

Fix Action

Fixed

PR fix notes

PR #54905: fix(ui): avoid rerendering chat thread on draft changes

Description (problem / solution / changelog)

Closes #54874

Summary

  • keep the chat thread behind a Lit guard() so draft-only updates do not rebuild the full message tree
  • track deleted-message mutations with a lightweight version counter so thread cache invalidates when messages are hidden
  • add a regression test that verifies changing the draft does not re-render message groups

Testing

  • pnpm --dir ui exec vitest run src/ui/views/chat.thread-cache.test.ts src/ui/views/chat.test.ts
  • pnpm --dir ui exec vitest run src/ui/views/chat.browser.test.ts
  • pnpm exec oxlint ui/src/ui/views/chat.ts ui/src/ui/views/chat.thread-cache.test.ts ui/src/ui/chat/deleted-messages.ts

Changed files

  • ui/src/ui/chat/deleted-messages.ts (modified, +11/-0)
  • ui/src/ui/views/chat.thread-cache.test.ts (added, +114/-0)
  • ui/src/ui/views/chat.ts (modified, +122/-98)

PR #54997: fix: prevent full re-render on every keystroke in webchat input

Description (problem / solution / changelog)

Fixes #54874

Root Cause

chatMessage was decorated with @state() in app.ts, causing Lit to trigger a full component re-render on every keystroke. With reasoning/verbose content in the chat history, this re-render is expensive (500ms–1s per key).

This explains why disabling reasoning/verbose partially mitigated the issue — less content to re-render.

Fix

Remove @state() from chatMessage. The textarea value is managed natively by the browser DOM; Lit only needs to sync it when other reactive state changes (e.g. on send/clear). This eliminates the per-keystroke re-render while keeping all existing behavior intact.

Bonus fix

Also normalizes prompt_tokens/completion_tokens aliases in cli-runner/helpers.ts for DashScope and other OpenAI-compatible providers (partial fix for #54859).

Changes

  • ui/src/ui/app.ts — remove @state() from chatMessage
  • src/agents/cli-runner/helpers.ts — add prompt_tokens/completion_tokens fallback aliases

Changed files

RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Summary

Summary Typing in the webchat input box is extremely slow - each keystroke causes a noticeable delay of 500ms-1s before the character appears. This makes typing feel unresponsive.

Steps to reproduce

  1. Open Safari or Chrome on Mac Mini<br>2. Navigate to OpenClaw webchat (http://localhost:18789/)<br>3. Start typing in the chat input box<br>4. Each keystroke causes 500ms-1s delay

Expected behavior

Typing should feel instant. Characters should appear immediately on each keystroke without any noticeable delay.

Actual behavior

Each keystroke causes 500ms-1s delay before character appears. Issue is specific to OpenClaw webchat - other websites work fine.

OpenClaw version

2026.3.24 (cff6dc9)

Operating system

macOS 25.3.0 (Darwin ARM64)

Install method

No response

Model

minimax-portal/MiniMax-M2.7-highspeed

Provider / routing chain

openclaw -> minimax-portal

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

Affected users: Anyone using OpenClaw webchat. Severity: Annoying. Frequency: Always on every keystroke.

Additional information

Root cause appears to be typing detection mechanism in webchat UI. Disabling reasoning/verbose partially helps.

extent analysis

Fix Plan

To address the typing delay issue in the OpenClaw webchat, we will focus on optimizing the typing detection mechanism in the webchat UI.

Steps to Fix:

  1. Debounce Input Handling: Implement debouncing to limit the frequency of input handling. This can be achieved by using a library like Lodash or implementing a custom debouncing function.
  2. Optimize Typing Detection: Review and optimize the typing detection mechanism to reduce unnecessary computations or API calls on each keystroke.
  3. Disable Unnecessary Features: Temporarily disable features like reasoning/verbose to verify if they are contributing to the delay.

Example Code (Debouncing with Lodash):

import _ from 'lodash';

const chatInput = document.getElementById('chat-input');
const debouncedHandleInput = _.debounce(handleInput, 100); // Debounce by 100ms

chatInput.addEventListener('input', debouncedHandleInput);

function handleInput() {
  // Input handling logic here
}

Verification

  • Test the webchat by typing in the input box after applying the fixes.
  • Verify that the typing feels instant and responsive without noticeable delays.

Extra Tips

  • Regularly review and optimize UI event handlers to prevent similar performance issues.
  • Consider using the browser's DevTools to profile and identify performance bottlenecks in the webchat UI.

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…

FAQ

Expected behavior

Typing should feel instant. Characters should appear immediately on each keystroke without any noticeable delay.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING