WebUI: extension loading can stall under the embedded browser's request budget (previously attempted in bf2046ff, reverted in 9e2a1b63)
Summary
Loading all WebUI extension points in parallel can exhaust the embedded
browser's request budget and stall extension loading. There is currently no
bound on the concurrency of /api/load_webui_extensions calls.
Where
webui/js/extensions.js loads every extension point concurrently on startup,
and webui/js/components.js:196-201 loads all top-level x-component
elements in parallel.
History
This was attempted and reverted:
bf2046ff— "Prevent WebUI extension loading stalls": serialized extension discovery through a promise chain (let extensionRequestQueue = Promise.resolve()) so the requests could not exhaust embedded Chromium request resources9e2a1b63— "Revert "Prevent WebUI extension loading stalls""
So the problem is believed to be real, but the proposed fix was rolled back. This issue is not a request to re-apply that patch — it is to decide whether serialization is still the right approach, or whether the rollback was for an unrelated reason that should be recorded.
What has landed since, and what it does not cover
83d369e7addedwebui/js/cache.js, caching JS and HTML per extension point. This helps repeat loads, not first paint, which is when all points are requested at once.0329003badded a UI asset bundler (helpers/ui_bundler.py) and a service worker (webui/sw.js), which reduces request count.
Neither bounds the concurrency of the initial burst across distinct extension points, and the cache is keyed per point, so the first paint still fans out one request per point.
Questions
- Was
bf2046ffreverted for a reason that still applies? If so, what replaced it? - Is there a measured concurrency at which the embedded browser starts stalling, so a bound can be chosen from data rather than guessed?
- Would a small bounded-concurrency pool (rather than full serialization, which makes first paint strictly sequential) be acceptable?
Reporting this from the plugin side: a plugin that worked around this had to
intercept window.fetch to serialize the burst, which is invasive and easy to
get wrong, so the fix is much better placed here.
Source: agent0ai/agent-zero