Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

fix(llm): send reasoning effort to Claude Haiku 5.5

Felipe Neves Ricardob295ae0793d0
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b43a8edc..c39f0938 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Fixed
+- Fixed `AI_MEMORY_LLM_REASONING_EFFORT` being ignored for
+ `claude-haiku-5-5`: the Anthropic provider dropped effort and thinking
+ fields for every Haiku model because Haiku 4.5 rejects them, so Haiku 5.5
+ always ran adaptive thinking at its default `medium` effort. Haiku 5.5 and
+ later now receive `output_config.effort`, adaptive thinking, and
+ `thinking: disabled` for `none`, like the other current Claude models
+ (#1180).
- Fixed Cursor tool calls being stored with no title or content: Cursor's own
hooks, and the Claude Code hooks Cursor also runs, send Claude's
`tool_name`/`tool_input` fields, but Cursor was missing from the tool-capture
diff --git a/crates/ai-memory-llm/src/anthropic.rs b/crates/ai-memory-llm/src/anthropic.rs
index f9b14bfd..150d2879 100644
--- a/crates/ai-memory-llm/src/anthropic.rs
+++ b/crates/ai-memory-llm/src/anthropic.rs
@@ -440,7 +440,8 @@ impl ClaudeFamily {
Self::Opus => Some((4, 5)),
Self::Sonnet => Some((4, 6)),
Self::Fable | Self::Mythos => Some((5, 0)),
- Self::Haiku => None,
+ // Haiku 4.5 400s on `output_config.effort`; Haiku 5.5 accepts it.
+ Self::Haiku => Some((5, 5)),
}
}
@@ -448,7 +449,7 @@ impl ClaudeFamily {
match self {
Self::Opus | Self::Sonnet => Some((4, 6)),
Self::Fable | Self::Mythos => Some((5, 0)),
- Self::Haiku => None,
+ Self::Haiku => Some((5, 5)),
}
}
}
@@ -752,6 +753,20 @@ mod tests {
)]
#[case::opus_5_disabled("claude-opus-5", ReasoningEffort::None, None, Some("disabled"))]
#[case::haiku_45_omits("claude-haiku-4-5", ReasoningEffort::Low, None, None)]
+ #[case::haiku_45_none_omits("claude-haiku-4-5", ReasoningEffort::None, None, None)]
+ #[case::haiku_55_adaptive(
+ "claude-haiku-5-5",
+ ReasoningEffort::Low,
+ Some("low"),
+ Some("adaptive")
+ )]
+ #[case::haiku_55_disabled("claude-haiku-5-5", ReasoningEffort::None, None, Some("disabled"))]
+ #[case::haiku_55_xhigh_kept(
+ "claude-haiku-5-5",
+ ReasoningEffort::XHigh,
+ Some("xhigh"),
+ Some("adaptive")
+ )]
#[case::opus_45_effort_only("claude-opus-4-5", ReasoningEffort::High, Some("high"), None)]
#[case::mythos_preview_none_omits_disabled(
"claude-mythos-preview",
diff --git a/docs/install.md b/docs/install.md
index a89bb289..a640fbf0 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -2140,9 +2140,9 @@ sends Chat Completions `reasoning_effort` (clamped to `low`/`medium`/`high`/
`xhigh`, because Grok cannot disable reasoning); other compat endpoints send
OpenAI-style `reasoning_effort`. Anthropic and Anthropic-OAuth map the same
key to `output_config.effort` and adaptive/disabled thinking on models that
-accept those fields (Haiku 4.5 omits them so the default model does not 400;
-Fable 5 / Mythos 5 / Mythos Preview omit `thinking: disabled` because those
-models reject it). `ultra` and `persistent` clamp to `max` on OpenAI-style
+accept those fields (Haiku 4.5 omits them because it rejects them, while Haiku
+5.5 receives them; Fable 5 / Mythos 5 / Mythos Preview omit
+`thinking: disabled` because those models reject it). `ultra` and `persistent` clamp to `max` on OpenAI-style
hosts. Gemini and Copilot ignore the key.
[Atlas Cloud](https://www.atlascloud.ai/models/qwen/qwen3.5-flash) uses the