Skip to content

[Automated] Draft docs (agentgateway): llm: make Bedrock Converse honor tool_choice - #1253

Merged
artberger merged 8 commits into
mainfrom
pr-tracker-draft-agentgateway-3812
Oct 16, 2026
Merged

artberger merged 8 commits into
mainfrom
pr-tracker-draft-agentgateway-3812

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Warning

1 reference(s) this draft adds appear in neither the code change (agentgateway/agentgateway#3812) nor these docs. Readers run what these pages say, so check each one before merging. A host marked no has never appeared in either.

Reference Kind Host seen before
https://github.com/agentgateway/agentgateway/pull/3812 URL yes

agentgateway/agentgateway#3812 — llm: make Bedrock Converse honor tool_choice

Docs versions: standalone/main, kubernetes/main

What changes for users: Bedrock Runtime requests now send client tool_choice settings as Converse toolChoice, so forced tool choices can take effect. Some requests that Bedrock previously accepted while ignoring the field can now return Bedrock errors when the selected model rejects forced tool use.

What the docs now say: The Amazon Bedrock provider pages for Kubernetes and standalone now explain Bedrock tool-choice conversion, forced tool-use errors, and extended-thinking behavior. The standalone Messages API page now says how auto, any, tool, none, and omitted tool choices convert to Bedrock Converse.

Not verified: No cluster or live Bedrock access in CI; the requests are unrun.

How agentgateway-3812 was drafted, and what was not verified

Plan, and what changed it

  • Planned: Document that Bedrock Converse now honors client tool_choice settings on the Bedrock provider pages.
  • Learned: The target pages span Kubernetes and standalone modes, and content/docs/standalone/main/documentation/llm/api-types/messages.md owns the Messages-to-Bedrock conversion detail; this came from the candidate pages and the code diff.
  • Did: Added Bedrock tool-choice prose to both Bedrock provider pages, added the Messages conversion detail, and wrote a proposed LLM release-note bullet.

Why a documentation change is necessary

The pull request changes Bedrock request serialization from tool_choice to toolChoice, and the golden snapshots show auto serialized as {"auto": {}}. The diff also stops rewriting Messages requests with extended thinking to any; the client choice is forwarded unchanged instead. The Bedrock provider pages documented format conversion and extended thinking, but did not say that client tool-choice settings reach Bedrock or that forced tool choice can now surface a Bedrock error. The Messages API page documented Bedrock Converse conversion, but did not list how tool_choice values convert.

No candidate page was rejected. The shared Bedrock provider page covers Kubernetes mode, the standalone Bedrock provider page covers standalone mode, and the Messages page covers the conversion-specific behavior.

The neighbor PRs in the dossier are separate Bedrock changes: #3721 covers prompt-cache preservation and #3776 covers streamed redacted reasoning. They do not carry the toolChoice behavior documented here.

What changed on disk

  • assets/agw-docs/pages/agentgateway/llm/providers/bedrock.md — Added a gated Tool choice section for Kubernetes-mode Bedrock Runtime behavior.
  • content/docs/standalone/main/integrations/llm/providers/bedrock.md — Added the same Tool choice section for standalone mode.
  • content/docs/standalone/main/documentation/llm/api-types/messages.md — Added how Messages tool_choice values convert to Bedrock Converse.

How to verify this change

  1. Configure a Bedrock provider by following the Amazon Bedrock provider page for the mode that you want to check.

  2. Send a chat request with a tool definition and "tool_choice": "required" through the Bedrock route.

    curl "$BEDROCK_ROUTE_URL/v1/chat/completions" -H content-type:application/json -d '{
      "model": "<bedrock-model>",
      "messages": [
        {
          "role": "user",
          "content": "Look up the weather for Portland."
        }
      ],
      "tools": [
        {
          "type": "function",
          "function": {
            "name": "lookup_weather",
            "description": "Look up weather by city.",
            "parameters": {
              "type": "object",
              "properties": {
                "city": {
                  "type": "string"
                }
              },
              "required": [
                "city"
              ]
            }
          }
        }
      ],
      "tool_choice": "required"
    }' | jq
  3. Check the Bedrock request or provider-side trace for toolChoice.any, or check that the response includes a tool call from a model that accepts forced tool use.

  4. Repeat with a Bedrock model that rejects forced tool use. The client receives the Bedrock error instead of a response that ignores tool_choice.

What was not verified

  • No live Bedrock access was available in CI, so the provider requests were not run.
  • The workflow named an internal repository#3188 and an internal repository#3194 as missing siblings, but their dossiers are not present for this item.
How the pages were chosen (triage report)

Feature clusters

Worked in another repository as well. This does not hold the cluster: a different repository documents itself in a different product's tree, on a schedule this run does not control. Listed so the other work is not a surprise later:

Cluster Also worked by What it is
c5 an internal repository#3188 agentgateway: llm-api-conversion tool use across conversions (mock and real providers) (merged)
c5 an internal repository#3194 agentgateway: llm-api-conversion on nightly builds only; retire fixed-issue tags (agentgateway#3041, #3811, agentgateway-enterprise#8311, #8312, #8350) (merged)

New configuration: no page mentions it yet

agentgateway/agentgateway#3812 — llm: make Bedrock Converse honor tool_choice

  • Product: agentgateway (upstream) → agentgateway/website
  • Docs version: standalone/main, kubernetes/main
  • Code issue: Bedrock (Converse): tool_choice is ignored because ToolConfiguration serializes tool_choice instead of toolChoice agentgateway#3811
  • Summary (read from the body): tool_choice never reached Bedrock Converse. ToolConfiguration serialized the field as tool_choice instead of toolChoice, and any / auto were serialized as strings instead of the objects Converse expects. Bedrock silently dropped the field, so "tool_choice": "required" or a named function had no effect on Claude models.
  • Not tested: no cluster was available, so every command in this diff is unrun
  • No rule covers 3 touched file(s). The candidate pages below come from the files that DID match a rule, so they may scope this narrower than the change is. Read these before deciding the change is only about the pages listed:
    • crates/llm/src/tests/requests/completions/full.bedrock.snap
    • crates/llm/src/tests/requests/responses/namespace-tools.bedrock.snap
    • crates/llm/src/types/bedrock.rs

Release notes

This pull request also adds its release-note entries:

  • content/docs/kubernetes/main/release-notes/release-notes.md: llm: make Bedrock Converse honor tool_choice (fix, under LLM)
  • content/docs/standalone/main/release-notes/release-notes.md: llm: make Bedrock Converse honor tool_choice (fix, under LLM)

Draft branch: pr-tracker-draft-agentgateway-3812

…or tool_choice

Signed-off-by: GitHub Action <action@github.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Deploying agentproxy with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9387209
Status:⚡️  Build in progress...

View logs

Signed-off-by: Kristin Brown <kristin.brown@solo.io>
Signed-off-by: Kristin Brown <kristin.brown@solo.io>
…eway-3812

Signed-off-by: Kristin Brown <kristin.brown@solo.io>
Resolve release-notes conflicts with the v1.7 fixes section on main.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Kristin Brown <kristin.brown@solo.io>
Resolve release-notes conflicts with the v1.7 sections on main.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Kristin Brown <kristin.brown@solo.io>
@artberger
artberger merged commit eadee51 into main Oct 16, 2026
5 of 6 checks passed
@artberger
artberger deleted the pr-tracker-draft-agentgateway-3812 branch October 16, 2026 18:16
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