Python: Fix Ollama approval resume message handling - #7480
Open
moonbox3 wants to merge 2 commits into
Open
Conversation
moonbox3
temporarily deployed
to
github-app-auth
August 3, 2026 05:02 — with
GitHub Actions
Inactive
moonbox3
temporarily deployed
to
github-app-auth
August 3, 2026 05:02 — with
GitHub Actions
Inactive
moonbox3
temporarily deployed
to
github-app-auth
August 3, 2026 05:02 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an incompatibility between AG-UI’s synthesized approval-resume user messages and the Ollama connector by dropping control-only approval-resume messages during Ollama message formatting, and adds a regression test to ensure the rest of the transcript (user → assistant tool call → tool result) still reaches Ollama.
Changes:
- Skip
role="user"messages that contain onlyfunction_approval_responsecontent when formatting user messages for Ollama. - Add a regression test validating the approval-resume message is omitted from the outgoing Ollama
messagespayload.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/packages/ollama/agent_framework_ollama/_chat_client.py | Drops control-only approval-resume user messages by returning an empty formatted message list. |
| python/packages/ollama/tests/test_ollama_chat_client.py | Adds a regression test asserting the approval-resume message is not forwarded to Ollama. |
Contributor
moonbox3
marked this pull request as ready for review
August 3, 2026 05:14
moonbox3
temporarily deployed
to
github-app-auth
August 3, 2026 05:14 — with
GitHub Actions
Inactive
moonbox3
temporarily deployed
to
github-app-auth
August 3, 2026 05:25 — with
GitHub Actions
Inactive
moonbox3
enabled auto-merge
August 3, 2026 05:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
AG-UI synthesizes a control-only user message when a user resumes an approved tool call. The Ollama connector rejected that message because it has no text or data content, preventing approval-gated tools from completing on AG-UI surfaces backed by Ollama.
Description & Review Guide
OllamaChatClient.get_response()API.Related Issue
Fixes #7451
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.