🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/21393
**Author:** [@lewisco](https://github.com/lewisco)
**Created:** 2/13/2026
**Status:** ❌ Closed
**Base:** `main` ← **Head:** `fix/jsonfield-double-deserialization`
---
### 📝 Commits (1)
- [`f2d93a8`](https://github.com/open-webui/open-webui/commit/f2d93a802590b22df2aa46f3db0d0aed79e8538b) fix: handle already-deserialized JSON values from PostgreSQL
### 📊 Changes
**1 file changed** (+5 additions, -2 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/internal/db.py` (+5 -2)
</details>
### 📄 Description
## Summary
- `JSONField.process_result_value` unconditionally calls `json.loads()` on column values, but PostgreSQL's `psycopg2` driver with native JSON handling returns Python dicts/lists directly from JSONB columns
- This causes `TypeError: the JSON object must be str, bytes or bytearray, not dict` on PostgreSQL deployments
- Fix adds a type check to skip deserialization when the value is already a `dict` or `list`
## Test plan
- [ ] Verify on PostgreSQL deployment that JSONB columns load without TypeError
- [ ] Verify on SQLite deployment that string-serialized JSON values still deserialize correctly
- [ ] Confirm no regression in chat history, user settings, or other JSONField-backed models
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/21393
Author: @lewisco
Created: 2/13/2026
Status: ❌ Closed
Base:
main← Head:fix/jsonfield-double-deserialization📝 Commits (1)
f2d93a8fix: handle already-deserialized JSON values from PostgreSQL📊 Changes
1 file changed (+5 additions, -2 deletions)
View changed files
📝
backend/open_webui/internal/db.py(+5 -2)📄 Description
Summary
JSONField.process_result_valueunconditionally callsjson.loads()on column values, but PostgreSQL'spsycopg2driver with native JSON handling returns Python dicts/lists directly from JSONB columnsTypeError: the JSON object must be str, bytes or bytearray, not dicton PostgreSQL deploymentsdictorlistTest plan
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.