The function does not accept a db parameter, but the call was passing db=db as a 4th argument, causing a TypeError.
Removed the errant db=db argument from the call site in routers/chats.py. The function operates on in-memory chat objects and writes to the chat_message table internally — no external db session needed at the call site.
🔄 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/22976
**Author:** [@BillionClaw](https://github.com/BillionClaw)
**Created:** 3/24/2026
**Status:** ❌ Closed
**Base:** `main` ← **Head:** `clawoss/fix/22959-remove-db-arg`
---
### 📝 Commits (2)
- [`08deec8`](https://github.com/open-webui/open-webui/commit/08deec86b1ff0f230705afa0a5ae38a0fe4cf1ac) fix(code-interpreter): inject Pyodide prompt into system message not user turn
- [`4c0977a`](https://github.com/open-webui/open-webui/commit/4c0977a1c02681e79bcc0917c8172a6277ea88be) fix(chats): remove errant db= argument from upsert_message call
### 📊 Changes
**2 files changed** (+4 additions, -3 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/routers/chats.py` (+0 -1)
📝 `backend/open_webui/utils/middleware.py` (+4 -2)
</details>
### 📄 Description
The function does not accept a `db` parameter, but the call was passing `db=db` as a 4th argument, causing a TypeError.
Removed the errant `db=db` argument from the call site in routers/chats.py. The function operates on in-memory chat objects and writes to the chat_message table internally — no external db session needed at the call site.
Fixes #22959
---
<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/22976
Author: @BillionClaw
Created: 3/24/2026
Status: ❌ Closed
Base:
main← Head:clawoss/fix/22959-remove-db-arg📝 Commits (2)
08deec8fix(code-interpreter): inject Pyodide prompt into system message not user turn4c0977afix(chats): remove errant db= argument from upsert_message call📊 Changes
2 files changed (+4 additions, -3 deletions)
View changed files
📝
backend/open_webui/routers/chats.py(+0 -1)📝
backend/open_webui/utils/middleware.py(+4 -2)📄 Description
The function does not accept a
dbparameter, but the call was passingdb=dbas a 4th argument, causing a TypeError.Removed the errant
db=dbargument from the call site in routers/chats.py. The function operates on in-memory chat objects and writes to the chat_message table internally — no external db session needed at the call site.Fixes #22959
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.