Skip to content

v0.56.2: forced tools and run metadata

Choose a tag to compare

@raphaelraphael released this 28 May 13:59
· 34 commits to main since this release
730439a

What changed

This patch makes forced tool-use turns feel boring again, in the best possible way.

When a planner says "the next assistant turn must call a tool," goa-ai now keeps that contract intact while encoding requests in the shape Anthropic and Bedrock actually accept. Anthropic models reject thinking/reasoning mode when tool_choice requires tool use, whether the request names one exact tool or says "call any tool." The Anthropic and Bedrock adapters now own that provider rule directly: they preserve the forced tool choice and omit thinking for that request.

The release also carries structured RunInput.Metadata into run.Context, giving application planners a first-class place for run-scoped state without squeezing domain data into string labels.

Why it matters

  • Task and workflow agents can force progress or completion tools without accidentally sending an invalid Anthropic/Bedrock request.
  • Planners stay focused on intent: ToolChoiceModeAny means "continue through tools," and ToolChoiceModeTool means "call this exact tool." Provider adapters handle the transport details.
  • Applications can pass typed, run-start metadata to planners through the runtime context instead of inventing label encodings.

Breaking changes

No intentional breaking changes.

One compatibility note: run.Context has a new Metadata map[string]any field. Code that constructs run.Context with keyed fields keeps working. If you have unkeyed struct literals, switch them to keyed literals; that is the safer style for exported runtime structs anyway.

Upgrade steps

  1. Update the dependency:

    go get goa.design/goa-ai@v0.56.2
  2. If your planner needs run-scoped structured state, pass it with RunInput.Metadata and read it from RunContext.Metadata.

  3. No planner changes are needed for forced tool-choice thinking compatibility. Keep using ToolChoiceModeAny or ToolChoiceModeTool; the Anthropic and Bedrock adapters now make those requests provider-safe.

Included checks

Validated locally before release:

  • make lint
  • make test

Release range: v0.56.1...v0.56.2.