mirror of
https://github.com/open-webui/computer.git
synced 2026-11-05 01:17:24 +00:00
[GH-ISSUE #85] feat(frontend): pretty-print JSON in tool call and param displays #39
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#39
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 @steamEngineer on GitHub (Jun 28, 2026).
Original GitHub issue: https://github.com/open-webui/computer/issues/85
Summary
Tool call outputs and JSON object parameters in the chat UI are currently rendered as minified one-line JSON strings, which makes debugging and reading tool results unnecessarily difficult.
This is a small frontend-only change that pretty-prints JSON with 2-space indentation wherever the UI already uses
JSON.stringifyfor display.What does this fix/solve?
{"status":"ok","items":[...]}) that are hard to scanAfter the change, valid JSON is formatted with indentation; non-JSON text is left unchanged.
Proposed changes
Three files, ~20 lines total:
cptr/frontend/src/lib/components/chat/ToolCallCollapsible.svelte$derivedformatter thatJSON.parses tool output when possible, thenJSON.stringify(value, null, 2)<pre>block (keeps existing 10k char truncation)cptr/frontend/src/lib/components/chat/PlusMenu.svelteJSON.stringify(value, null, 2)for object param valuescptr/frontend/src/lib/components/Admin/Models.svelteNo new dependencies. Falls back to raw string when output is not valid JSON.
Test plan
Contributor note
I have a working patch on branch
feat/pretty-json-debugbut I am unable to open a pull request directly against this repository (no push/PR permissions from my fork). Happy to share the full diff or adjust based on maintainer feedback — please let me know the preferred contribution path.Commit message used locally:
@steamEngineer commented on GitHub (Jun 28, 2026):
Branch is now pushed to my fork — the push had been blocked by GitHub email privacy (GH007) because the commit used a private Gmail as committer; fixed with the noreply address.
Fork branch (single commit on
upstream/main): https://github.com/steamEngineer/computer/tree/feat/pretty-jsonCompare / patch: https://github.com/open-webui/computer/compare/main...steamEngineer💻feat/pretty-json
Commit:
c93c52b— 3 files, +16/−7 lines.I still can't open a PR directly against this repo from my account; happy for a maintainer to cherry-pick or open the PR from the compare link above.
@tjbck commented on GitHub (Jun 30, 2026):
Should be addressed!