mirror of
https://github.com/open-webui/computer.git
synced 2026-11-05 01:17:24 +00:00
[GH-ISSUE #246] bug: image previews never render on Windows — frontend sends backslash paths to /api/workspace/files/serve #159
Labels
No labels
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/computer#159
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gucazcode on GitHub (Aug 31, 2026).
Original GitHub issue: https://github.com/open-webui/computer/issues/246
Version: 0.9.21 · OS: Windows 11 · Browser: Chrome
Summary
On Windows, no image ever renders inline.
display_filedraws the viewer panel — title bar, zoomcontrols,
100%— but the image itself is a broken-image icon, and the size readout shows0 B.The backend is fine. The frontend builds the URL from a raw Windows path, without converting
backslashes to forward slashes and without URL-encoding, while the serve endpoint expects
forward slashes — as its own comment says.
Reproduce
display_filethat PNG (or open it from the file browser).0 B.Root cause
Frontend —
_app/immutable/nodes/2.*.js:n.filePathon Windows is e.g.C:\Users\user\workspace\example.png(confirmed — it appearsverbatim as the broken image's
alttext). It is interpolated raw: no separator normalisation,no encoding.
Backend —
routers/workspace.py:The comment states the contract —
C:/Users/..., forward slashes — which the frontend doesnot meet.
Evidence the backend is correct
This URL, in a logged-in browser, renders the image correctly:
Same file, same session, forward slashes instead of backslashes. So routing, auth, MIME detection
and streaming all work; only the URL the frontend builds is wrong.
Suggested fix
Normalise separators before interpolating, and encode each segment:
Encoding also fixes paths containing spaces,
#or?, which will fail on every platform.Related: the bundle already has a resolver,
de(), which prefersfull_path, falls back topath, and joins relative paths to the workspace root. The image viewer bypasses it — andde()does not normalise separators either, so both call sites likely need the same treatment.
Workaround in use
Until this is fixed upstream, we patch the built bundle in place, rewriting the interpolation to
normalise separators. It works, but it is a stopgap: an upgrade replaces the bundle and silently
reverts it, so the patch has to be re-applied and verified after every update. A fix in the
source is the real answer.
Anyone hitting this before a release can also open the file directly at
/api/workspace/files/view?path=<url-encoded absolute path>, which serves correctly.@owui-terminator[bot] commented on GitHub (Aug 31, 2026):
⚠️ Missing Issue Title Prefix
@gucazcode, your issue title is missing a categorising prefix (e.g.
bug:,feat:,docs:).Please update the title to lead with one of:
Example:
bug: Login fails when the password contains special characters