Add Bedrock model profiles for Writer, Z.AI, and Moonshot AI, and refresh `LatestBedrockModelNames`
Related to #6081 (Bedrock toolResult co-location). Follow-up for the supports_tools=False handling of tools-less models: #6186.
What
Several Bedrock provider prefixes fell through to the default model profile, leaving their capabilities undetected (and, for Writer, their tool use completely broken). This adds proper profiles for Writer, Z.AI, and Moonshot AI, and refreshes the LatestBedrockModelNames list to current Converse models.
Every flag was live-verified against Bedrock us-east-1 rather than inferred — this is the kind of test a contributor without Bedrock access can't record.
Live-verified capability matrix
| family | Bedrock ids | tool choice | leading assistant | text co-location | native structured output | media in toolResult |
|---|---|---|---|---|---|---|
| Z.AI | zai.glm-4.7, glm-4.7-flash, glm-5 | ✅ | ✅ | ✅ | ✅ (+ strict tools) | text-only |
| Moonshot | moonshot.kimi-k2-thinking, moonshotai.kimi-k2.5 | ✅ | ✅ | ✅ | ✅ (+ strict tools) | ❌ → deferred to a following turn |
| Writer | writer.palmyra-x4, palmyra-x5 | ❌ | ❌ | ❌ rejected | ❌ | n/a |
Writer had two real, reproduced defects (its tool use was 100% broken)
- Co-location: like Llama/Mistral, Writer rejects any content sharing a
toolResult's turn ("Conversation blocks and tool result blocks cannot be provided in the same turn"). Fixed withbedrock_tool_result_colocatable_content=frozenset(), which triggers the existing synthetic-assistant-turn split. statusfield: Writer uniquely rejects thestatusfield on atoolResultblock ("This model doesn't support the status field. Remove status and try again.") — surfaced while recording the co-location cassette. Added a newbedrock_supports_tool_result_statusprofile flag (defaultTrue) that gates the field. Both fixes together produce a working round-trip.
Moonshot media
Kimi accepts an image in a plain user message but rejects any media (image or document) inside a toolResult's content. Setting bedrock_supported_media_kinds_in_tool_returns=frozenset() routes such media to a following user turn via the existing deferral path (#6259), which Kimi reads fine — same behavior Qwen already uses.
LatestBedrockModelNames refresh
boto3 ships no static model-id enum, so the list is regenerated from the live list_foundation_models + list_inference_profiles SDK APIs. Adds the previously-missing supported families (Qwen, DeepSeek, Google Gemma, MiniMax, NVIDIA Nemotron, Writer, Z.AI, Moonshot AI) and newer models for existing ones (Llama 4, Nova Premier, Mistral-3/pixtral/ministral/magistral/devstral, Anthropic opus-4.1→4.8/sonnet-5/fable-5), each in its correct invokable form — bare for on-demand families, geo-prefixed (us./global.) for cross-region-only ones. Every id in the list resolves to a real Bedrock model profile.
Not in scope
ai21.jamba-*: AWS marks it Legacy and blocks access ("marked by provider as Legacy and you have not been actively using the model in the last 30 days"), so no flag can be verified. Dropped from both the dispatch and the model-names list.writer.palmyra-vision-7brejects tool use entirely — that's the general "model doesn't support tools" gap tracked in #6186, not something to special-case here.
Tests
- Provider-profile flag assertions for Z.AI, Moonshot (both
moonshot./moonshotai.keys), and Writer. - Resolution-matrix snapshots for the three new families.
- VCR cassettes (real Converse requests): Writer co-location round-trip, Z.AI tool + native structured output, Moonshot Kimi tool call.
- Unit test pinning Writer's
statusomission on both success and errortoolResults (the VCR matcher isn't body-sensitive, so a regression could otherwise pass green).
All Bedrock provider + model tests green; changed files pyright-clean.
Checklist
- Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
- No breaking changes in accordance with the version policy.
- PR title is fit for the release changelog.