Skip to content

fix: preserve tool_call_id in _create_standard_choice#49

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/justllms-repository-improvements-fe21
Draft

fix: preserve tool_call_id in _create_standard_choice#49
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/justllms-repository-improvements-fe21

Conversation

@cursor

@cursor cursor Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes a bug where OpenAI-compatible providers dropped tool_call_id when parsing API responses through the shared _create_standard_choice helper.

Azure OpenAI already preserved this field in its custom response parser (#40), but Grok, DeepSeek, Ollama, and OpenAI use the shared helper — so tool-role messages lost the ID required for multi-turn tool calling.

Changes

  • Pass tool_call_id through in BaseProvider._create_standard_choice
  • Add tests/test_base_provider.py with regression coverage

Branch

Feature branch: darshan/fix-standard-choice-tool-call-id

Testing

All CI checks pass locally:

  • ruff check justllms/
  • black --check justllms/ tests/
  • mypy justllms/ --ignore-missing-imports
  • pytest tests/ -v (96 passed)
  • python3 -m build
Open in Web View Automation 

OpenAI-compatible providers parse API responses through
_create_standard_choice, which dropped tool_call_id from tool-role
messages. Azure already handled this in its custom parser; align the
shared helper so Grok, DeepSeek, Ollama, and OpenAI keep the ID needed
for multi-turn tool calling.

Co-authored-by: Darshan Harihar <DarshanHarihar1@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant