v0.56.2: forced tools and run metadata
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:
ToolChoiceModeAnymeans "continue through tools," andToolChoiceModeToolmeans "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
-
Update the dependency:
go get goa.design/goa-ai@v0.56.2
-
If your planner needs run-scoped structured state, pass it with
RunInput.Metadataand read it fromRunContext.Metadata. -
No planner changes are needed for forced tool-choice thinking compatibility. Keep using
ToolChoiceModeAnyorToolChoiceModeTool; the Anthropic and Bedrock adapters now make those requests provider-safe.
Included checks
Validated locally before release:
make lintmake test
Release range: v0.56.1...v0.56.2.