Skip to content

fix(bedrock): avoid unsupported inference profile JSON prefill - #4095

Merged
crazywoola merged 4 commits into
langgenius:mainfrom
Taranum01:fix/plugins-2824-oct22
Oct 24, 2026
Merged

crazywoola merged 4 commits into
langgenius:mainfrom
Taranum01:fix/plugins-2824-oct22

Conversation

@Taranum01

Copy link
Copy Markdown
Contributor

Summary

Keep JSON formatting instructions in the system message without adding an unsupported assistant prefill for Claude 4.6+ inference profiles. Route the SDK code-block wrapper through the underlying-model capability check. Preserve prefill for older Claude profiles and keep native JSON-schema output precedence. Do not duplicate the first user message as system instructions.

Fixes #2824

Release Notes

Fix JSON response formatting for Claude inference profiles that reject assistant-message prefill.

Testing

  • python -m pytest -q tests: 283 passed.
  • Thirteen regression cases fail on main and pass with the fix.
  • Both SDK wrapper and direct invoke paths are covered across six model IDs, with legacy prefill and native schema controls.

Change Type

  • LLM plugin

Version

  • Bumped top-level manifest version from 0.0.90 to 0.0.91.

@crazywoola

Copy link
Copy Markdown
Member

Hi @Taranum01, thanks a lot for these Bedrock fixes!

We noticed that #4094 and #4095 both update the Bedrock plugin and bump models/bedrock/manifest.yaml to the same next version (0.0.90 → 0.0.91), so unfortunately they can't both be released as separate PRs.

Could you please consolidate the changes from #4094 into this PR (or the other way around) so both fixes can ship together as a single release? We've closed #4094 in the meantime to keep the release queue clean — happy to reopen it if anything was missed.

Thanks again for your contributions! 🙏

Taranum01 added 2 commits October 23, 2026 10:39
@crazywoola

Copy link
Copy Markdown
Member

Hi @Taranum01, thanks for fixing the unsupported inference-profile JSON prefill on Bedrock!

Heads-up: #3794 also targets models/bedrock and was closed just now because it has merge conflicts with main. Could you please fold the non-InvokeError exception-propagation fix from #3794 into this PR if it's still needed, and reference both issues (#2824 and #3653) in the description?

Version note: the consolidated dependency refresh (#4106–#4111) bumped models/bedrock to 0.0.92 on main, and #4112 from another author also targets this plugin. Please rebase on latest main and coordinate the bump so only one PR takes the next version.

Thanks again! 🙏

@crazywoola
crazywoola deployed to models/bedrock October 24, 2026 08:00 — with GitHub Actions Active
@crazywoola
crazywoola merged commit 58bbd01 into langgenius:main Oct 24, 2026
4 checks passed
Arai-Y-SLC added a commit to Arai-Y-SLC/dify-official-plugins that referenced this pull request Oct 25, 2026
main is now 0.0.92 (langgenius#4106, langgenius#4095), so bump to the next unused version.

langgenius#4095 added a test that expected no Claude 5 response field paths for a
Haiku 5.5 profile ID. With Haiku 5.5 registered as a Claude 5 model,
profile IDs such as global.anthropic.claude-haiku-5-5 now request
/stop_details like the other Claude 5 models; the application inference
profile ARN case is unchanged. Also note in the README that Haiku 5.5 is
now a predefined model.
crazywoola pushed a commit that referenced this pull request Oct 26, 2026
… Claude 5 (#4112)

* feat(bedrock): add thinking display option for Claude 5 models

Add a `thinking_display` parameter (omitted / summarized) to the
"Anthropic Claude 5" family. Claude 5 adaptive thinking defaults to
`omitted`, so nothing is streamed while the model thinks. With
`summarized`, reasoning summaries are streamed, which keeps the
connection from going idle during long thinking.

- Send `thinking.display = "summarized"` when selected; requests with
  `omitted` or no value are unchanged.
- Allow `summarized` without Effort: send adaptive thinking only, with
  no output_config, and still drop sampling params.
- Add tests, README notes, and bump the plugin version to 0.0.92.

* feat(bedrock): add Claude Haiku 5.5

Add Claude Haiku 5.5 (anthropic.claude-haiku-5-5) to the "Anthropic
Claude 5" model family.

- model_ids: register 'Haiku 5.5' and its geo profile prefixes
  (us/eu/au/global; the jp. profile is not wired up yet, as for Opus 5.5)
- anthropic-claude-5.yaml: add the model option and update the
  cross-region help text
- llm.py: map 'Haiku 5.5' to the new pricing file
- model_configurations/claude-5-5-haiku.yaml: 1M context, Global rates
  of $0.10 / $0.50 per 1M tokens (prompts up to 100K tokens)
- cache_config: enable explicit prompt caching (min 512 tokens,
  4 checkpoints)
- README (en / zh_Hans): document the model, profiles and pricing
- tests: add Haiku 5.5 to the Claude 5 model id, cache and llm param
  tests, plus regression tests for custom (inference profile) models
- bump plugin version to 0.0.92

Because Haiku 5.5 profile IDs are now recognised as Claude 5 profiles,
custom models using them get the Claude 5 parameter rules (no
temperature/top_p/top_k) instead of the legacy Claude ones.

Fixes #4044

* chore(bedrock): bump to 0.0.93 after merging main

main is now 0.0.92 (#4106, #4095), so bump to the next unused version.

#4095 added a test that expected no Claude 5 response field paths for a
Haiku 5.5 profile ID. With Haiku 5.5 registered as a Claude 5 model,
profile IDs such as global.anthropic.claude-haiku-5-5 now request
/stop_details like the other Claude 5 models; the application inference
profile ARN case is unchanged. Also note in the README that Haiku 5.5 is
now a predefined model.

---------

Co-authored-by: Y.A-SLC <217139054+Arai-Y-SLC@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
models/bedrock — 126a84b2 Deployed Oct 24, 2026 by crazywoola via test (models/bedrock) #2910
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.

[Bedrock] When choose response_format as json, LLM will report error

2 participants