[PR #24825] [CLOSED] Handle decoded Ollama tool call arguments #131540

Closed
opened 2026-05-21 17:10:03 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/24825
Author: @pragnyanramtha
Created: 5/17/2026
Status: ❌ Closed

Base: main ← Head: codex/ollama-tool-call-arguments


📝 Commits (1)

  • 1b83736 Handle decoded Ollama tool call arguments

📊 Changes

2 files changed (+80 additions, -2 deletions)

View changed files

➕ backend/open_webui/test/utils/test_payload.py (+70 -0)
📝 backend/open_webui/utils/payload.py (+10 -2)

📄 Description

Summary

  • handle OpenAI tool-call arguments that are already decoded or omitted when converting chat messages to Ollama format
  • add focused payload conversion tests for JSON-string, decoded-dict, and missing tool-call arguments

Why

Some OpenAI-compatible chat/tool flows can produce function.arguments as an object or omit it. The Ollama conversion path previously called json.loads unconditionally, which raised before the request could be sent.

Validation

  • TMPDIR=/tmp PYTHONPATH=/home/ubuntu/gh-pr/open-webui-worker-next/backend uv run --no-project --python 3.12 --with pytest --with python-mimeparse --with Markdown --with beautifulsoup4 --with cryptography --with-requirements backend/requirements-min.txt pytest backend/open_webui/test/utils/test_payload.py -q
  • TMPDIR=/tmp uv run --no-project --python 3.12 --with ruff ruff format --check backend/open_webui/utils/payload.py backend/open_webui/test/utils/test_payload.py
  • TMPDIR=/tmp uv run --no-project --python 3.12 --with ruff ruff check backend/open_webui/test/utils/test_payload.py

🔄 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/24825 **Author:** [@pragnyanramtha](https://github.com/pragnyanramtha) **Created:** 5/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/ollama-tool-call-arguments` --- ### 📝 Commits (1) - [`1b83736`](https://github.com/open-webui/open-webui/commit/1b83736b25396b016a7b09bb172187832693c1af) Handle decoded Ollama tool call arguments ### 📊 Changes **2 files changed** (+80 additions, -2 deletions) <details> <summary>View changed files</summary> ➕ `backend/open_webui/test/utils/test_payload.py` (+70 -0) 📝 `backend/open_webui/utils/payload.py` (+10 -2) </details> ### 📄 Description ## Summary - handle OpenAI tool-call arguments that are already decoded or omitted when converting chat messages to Ollama format - add focused payload conversion tests for JSON-string, decoded-dict, and missing tool-call arguments ## Why Some OpenAI-compatible chat/tool flows can produce `function.arguments` as an object or omit it. The Ollama conversion path previously called `json.loads` unconditionally, which raised before the request could be sent. ## Validation - `TMPDIR=/tmp PYTHONPATH=/home/ubuntu/gh-pr/open-webui-worker-next/backend uv run --no-project --python 3.12 --with pytest --with python-mimeparse --with Markdown --with beautifulsoup4 --with cryptography --with-requirements backend/requirements-min.txt pytest backend/open_webui/test/utils/test_payload.py -q` - `TMPDIR=/tmp uv run --no-project --python 3.12 --with ruff ruff format --check backend/open_webui/utils/payload.py backend/open_webui/test/utils/test_payload.py` - `TMPDIR=/tmp uv run --no-project --python 3.12 --with ruff ruff check backend/open_webui/test/utils/test_payload.py` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-21 17:10:04 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#131540