← Back to PRs

#7316: fix: /chat dashboard performance

by felipcsousa open 2026-02-02 17:53 View on GitHub →
app: web-ui
### UI: reduce log fetch contention ## Description Summary - prevent concurrent log fetches with an in-flight guard to avoid re-entrancy - slow debug polling to reduce contention during heavy UI activity ## Problem The /chat route could freeze in the browser when multiple log loads were triggered concurrently. ## Solution - Introduce a logsInFlight guard so only one log fetch runs at a time, and - increase the debug polling interval to lower pressure on the UI loop. ## Testing - not run (not requested) <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR reduces `/chat` UI contention by (1) slowing debug polling from 3s to 10s (`ui/src/ui/app-polling.ts`) and (2) adding a `logsInFlight` state flag (`ui/src/ui/app.ts`) used by `loadLogs` to prevent concurrent `logs.tail` fetches (`ui/src/ui/controllers/logs.ts`). The concurrency guard should mitigate re-entrant log loads, but as implemented it also suppresses non-quiet/manual refresh attempts while any request is in flight. Additionally, the new `patch-openclaw-dashboard.sh` script appears to be an environment-specific, brittle patcher for built/minified assets (hardcoded Homebrew global install paths and hashed asset filenames), which is likely to break across installs and upgrades. <h3>Confidence Score: 3/5</h3> - Mostly safe to merge, but a couple behavior/maintainability concerns should be addressed first. - The core UI changes are small and likely fix the reported re-entrancy issue, but the in-flight guard can unintentionally ignore user-triggered refreshes, and the added patch script is brittle and environment-specific (hardcoded dist paths and hashed asset edits) which could confuse users or break in CI/tooling. - ui/src/ui/controllers/logs.ts, patch-openclaw-dashboard.sh <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs