Skip to content

feat: parallel_tool_calls + tool-calling tests#244

Merged
bernardladenthin merged 1 commit into
bernardladenthin:mainfrom
vaiju1981:tools-support
Jun 20, 2026
Merged

feat: parallel_tool_calls + tool-calling tests#244
bernardladenthin merged 1 commit into
bernardladenthin:mainfrom
vaiju1981:tools-support

Conversation

@vaiju1981

@vaiju1981 vaiju1981 commented Jun 20, 2026

Copy link
Copy Markdown

Summary

Test plan

  • Affected unit / integration tests pass locally
  • CI is green on this branch
  • Docs / CHANGELOG updated where applicable

Related issues / PRs

Checklist

  • I have read CONTRIBUTING.md and CODE_OF_CONDUCT.md
  • My commits follow Conventional Commits
  • No security-sensitive changes (if there are, I have notified the maintainer privately per SECURITY.md)

@bernardladenthin bernardladenthin changed the title Adding Tools Support feat: parallel_tool_calls + tool-calling tests Jun 20, 2026
@bernardladenthin bernardladenthin merged commit 6acd081 into bernardladenthin:main Jun 20, 2026
15 of 25 checks passed
bernardladenthin pushed a commit that referenced this pull request Jun 20, 2026
…ble surfaces

#244 made the chat core honor parallel_tool_calls, but only the OpenAI
/v1/chat/completions surface forwarded it; the alternative protocol surfaces (which
translate into that same chat core) silently dropped the equivalent flag. Close the gap:

- Anthropic /v1/messages (AnthropicApiSupport.toOpenAiChatRequest): map
  tool_choice.disable_parallel_tool_use=true -> parallel_tool_calls=false (default stays
  parallel when unset/false).
- OpenAI Responses /v1/responses (ResponsesApiSupport.toOpenAiChatRequest): forward
  parallel_tool_calls, and also forward tool_choice (string form), which was being dropped
  entirely — both now reach the shared OpenAiRequestMapper.

Tests:
- AnthropicApiSupportTest / ResponsesApiSupportTest: unit-cover the new mappings (set, and
  omitted-when-absent).
- OpenAiServerToolCallingIntegrationTest (new): real-model end-to-end over HTTP using the
  Qwen2.5-1.5B tool model #244 wired into CI. tool_choice="required" forces a call, so it
  deterministically asserts the server returns a well-formed tool_calls array (arguments as a
  JSON string, llama.cpp #20198) and that parallel_tool_calls=false travels
  HTTP -> mapper -> native intact. Self-skips when the model is absent.

Verified locally: spotless, compile, spotbugs clean; model-free translator tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JdLpWD8nedY7LwNnHefZLF

Copy link
Copy Markdown
Owner

Thanks @vaiju1981 for landing parallel_tool_calls and the ToolCallingAgent concept here in #244! 🙏

PR #243 builds directly on it. Now that the chat core honors parallel_tool_calls, #243 propagates it across the other OpenAI-compatible server surfaces, so the behavior is consistent instead of being honored only on /v1/chat/completions:

  • Anthropic /v1/messages — maps tool_choice.disable_parallel_tool_use: trueparallel_tool_calls: false
  • OpenAI Responses /v1/responses — forwards parallel_tool_calls (and tool_choice, which had been dropped entirely)
  • A server-level, end-to-end tool-calling integration test over HTTP, reusing the Qwen2.5-1.5B tool model you wired into CI here (tool_choice: "required" to deterministically assert a well-formed tool_calls array with arguments as a JSON string).

Your groundwork made each of these a small, focused addition — much appreciated! 🚀


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants