I have searched for any existing and/or related issues.
I have searched for any existing and/or related discussions.
I have also searched in the CLOSED issues AND CLOSED discussions and found no related items.
I am using the latest version of Open WebUI.
Installation Method
Docker
Open WebUI Version
v0.7.2
Ollama Version (if applicable)
N/A (using AWS Bedrock via LiteLLM)
Operating System
Kubernetes (Linux containers)
Browser (if applicable)
Chrome, Safari
Confirmation
I have read and followed all instructions in README.md.
I am using the latest version of Open WebUI.
I have included the browser console logs.
I have included relevant code analysis.
I have provided every relevant configuration, setting, and environment variable used in my setup.
I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation.
Expected Behavior
When a tool call completes without any embeds (e.g., image generation tools), the UI should cleanly display the tool result without any spurious rendered content.
Actual Behavior
An empty object {} is rendered in a red box in the UI after tool calls that don't return embeds. The browser console shows:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Root Cause Analysis
In backend/open_webui/utils/middleware.py at line 2388:
The check if embeds && Array.isArray(embeds) fails
Empty string gets rendered as {}
Steps to Reproduce
Use any tool that doesn't return embeds (e.g., built-in image generation)
Send a prompt like "Generate an image of a cat"
Wait for the tool to execute
Observe {} rendered in the UI and JSON parse error in console
Proposed Fix
# Change default from "" to []tool_result_embeds=result.get("embeds",[])# Only include embeds attribute when non-emptyembeds_attr=f' embeds="{html.escape(json.dumps(tool_result_embeds))}"'iftool_result_embedselse''
I have a PR ready with this fix.
Logs & Screenshots
Browser console error:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Stored message content showing the problematic attribute:
Originally created by @cannontrodder on GitHub (Jan 28, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20991
### Check Existing Issues
- [x] I have searched for any existing and/or related issues.
- [x] I have searched for any existing and/or related discussions.
- [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items.
- [x] I am using the latest version of Open WebUI.
### Installation Method
Docker
### Open WebUI Version
v0.7.2
### Ollama Version (if applicable)
N/A (using AWS Bedrock via LiteLLM)
### Operating System
Kubernetes (Linux containers)
### Browser (if applicable)
Chrome, Safari
### Confirmation
- [x] I have read and followed all instructions in `README.md`.
- [x] I am using the latest version of Open WebUI.
- [x] I have included the browser console logs.
- [x] I have included relevant code analysis.
- [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.**
- [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**.
### Expected Behavior
When a tool call completes without any embeds (e.g., image generation tools), the UI should cleanly display the tool result without any spurious rendered content.
### Actual Behavior
An empty object `{}` is rendered in a red box in the UI after tool calls that don't return embeds. The browser console shows:
```
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
```
### Root Cause Analysis
In `backend/open_webui/utils/middleware.py` at line 2388:
```python
tool_result_embeds = result.get("embeds", "")
tool_calls_display_content = f'...embeds="{html.escape(json.dumps(tool_result_embeds))}"...'
```
When `embeds` is missing from the result:
1. Default value is `""` (empty string)
2. `json.dumps("")` → `'""'`
3. `html.escape('""')` → `'""'`
4. HTML attribute becomes `embeds=""""`
In the frontend (`Collapsible.svelte` line 96):
```javascript
{@const embeds = parseJSONString(decode(attributes?.embeds ?? ''))}
```
1. `decode('""')` → `""`
2. `JSON.parse('""')` → `""` (empty string, not array)
3. The check `if embeds && Array.isArray(embeds)` fails
4. Empty string gets rendered as `{}`
### Steps to Reproduce
1. Use any tool that doesn't return embeds (e.g., built-in image generation)
2. Send a prompt like "Generate an image of a cat"
3. Wait for the tool to execute
4. Observe `{}` rendered in the UI and JSON parse error in console
### Proposed Fix
```python
# Change default from "" to []
tool_result_embeds = result.get("embeds", [])
# Only include embeds attribute when non-empty
embeds_attr = f' embeds="{html.escape(json.dumps(tool_result_embeds))}"' if tool_result_embeds else ''
```
I have a PR ready with this fix.
### Logs & Screenshots
Browser console error:
```
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
```
Stored message content showing the problematic attribute:
```html
<details type="tool_calls" ... embeds="""">
```
@cannontrodder commented on GitHub (Jan 28, 2026):
PR #20993 is now in draft mode. I'll be testing it locally shortly and will update once I've verified the fix works as expected.
<!-- gh-comment-id:3810899605 -->
@cannontrodder commented on GitHub (Jan 28, 2026):
PR #20993 is now in draft mode. I'll be testing it locally shortly and will update once I've verified the fix works as expected.
@cannontrodder commented on GitHub (Jan 28, 2026):
Resubmitted as #20996 with a clean single commit (rebased and squashed as requested).
<!-- gh-comment-id:3811533393 -->
@cannontrodder commented on GitHub (Jan 28, 2026):
Resubmitted as #20996 with a clean single commit (rebased and squashed as requested).
@cannontrodder commented on GitHub (Jan 28, 2026):
@Classic298 Resubmitted as #20996 with a clean single commit as requested. Ready for review when you get a chance.
<!-- gh-comment-id:3811540769 -->
@cannontrodder commented on GitHub (Jan 28, 2026):
@Classic298 Resubmitted as #20996 with a clean single commit as requested. Ready for review when you get a chance.
@cannontrodder commented on GitHub (Jan 28, 2026):
Closing - the symptoms we observed were caused by a WAF configuration issue in our infrastructure, not an upstream bug. The 403 response from the WAF was being parsed as JSON, causing the error. Apologies for the noise.
<!-- gh-comment-id:3812018298 -->
@cannontrodder commented on GitHub (Jan 28, 2026):
Closing - the symptoms we observed were caused by a WAF configuration issue in our infrastructure, not an upstream bug. The 403 response from the WAF was being parsed as JSON, causing the error. Apologies for the noise.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @cannontrodder on GitHub (Jan 28, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20991
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.7.2
Ollama Version (if applicable)
N/A (using AWS Bedrock via LiteLLM)
Operating System
Kubernetes (Linux containers)
Browser (if applicable)
Chrome, Safari
Confirmation
README.md.Expected Behavior
When a tool call completes without any embeds (e.g., image generation tools), the UI should cleanly display the tool result without any spurious rendered content.
Actual Behavior
An empty object
{}is rendered in a red box in the UI after tool calls that don't return embeds. The browser console shows:Root Cause Analysis
In
backend/open_webui/utils/middleware.pyat line 2388:When
embedsis missing from the result:""(empty string)json.dumps("")→'""'html.escape('""')→'""'embeds=""""In the frontend (
Collapsible.svelteline 96):decode('""')→""JSON.parse('""')→""(empty string, not array)if embeds && Array.isArray(embeds)fails{}Steps to Reproduce
{}rendered in the UI and JSON parse error in consoleProposed Fix
I have a PR ready with this fix.
Logs & Screenshots
Browser console error:
Stored message content showing the problematic attribute:
@cannontrodder commented on GitHub (Jan 28, 2026):
Fix submitted in #20993
@cannontrodder commented on GitHub (Jan 28, 2026):
PR #20993 is now in draft mode. I'll be testing it locally shortly and will update once I've verified the fix works as expected.
@cannontrodder commented on GitHub (Jan 28, 2026):
Resubmitted as #20996 with a clean single commit (rebased and squashed as requested).
@cannontrodder commented on GitHub (Jan 28, 2026):
@Classic298 Resubmitted as #20996 with a clean single commit as requested. Ready for review when you get a chance.
@cannontrodder commented on GitHub (Jan 28, 2026):
Closing - the symptoms we observed were caused by a WAF configuration issue in our infrastructure, not an upstream bug. The 403 response from the WAF was being parsed as JSON, causing the error. Apologies for the noise.