From 75100d4b8698c11b42fc0d35f7dcde92c0e7e661 Mon Sep 17 00:00:00 2001 From: Andrei Hasna Date: Mon, 6 Jul 2026 04:29:48 +0300 Subject: [PATCH] fix(ollama): align Responses API minimum version with 0.13.3 docs Ollama's official OpenAI-compatibility docs state `/v1/responses` was added in v0.13.3 (non-stateful only). Codewith's Ollama Responses usage is stateless (no previous_response_id/conversation reliance), so there is no Codewith-specific behavior requiring the previous 0.13.4 floor. Lower `min_responses_version()` to 0.13.3 and flip the cutoff tests so 0.13.2 fails and 0.13.3 passes. Dev-zero (0.0.0) behavior and the user-facing old-version error shape are preserved. Co-Authored-By: Claude Opus 4.8 --- codex-rs/ollama/src/lib.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/codex-rs/ollama/src/lib.rs b/codex-rs/ollama/src/lib.rs index 941f07dc87..47e2827d7e 100644 --- a/codex-rs/ollama/src/lib.rs +++ b/codex-rs/ollama/src/lib.rs @@ -50,7 +50,9 @@ pub async fn ensure_oss_ready(config: &Config) -> std::io::Result<()> { } fn min_responses_version() -> Version { - Version::new(0, 13, 4) + // Ollama's OpenAI-compatibility docs list `/v1/responses` as added in v0.13.3 + // (non-stateful only). Codewith's usage is stateless, so 0.13.3 is the floor. + Version::new(0, 13, 3) } fn supports_responses(version: &Version) -> bool { @@ -87,12 +89,12 @@ mod tests { #[test] fn does_not_support_responses_before_cutoff() { - assert!(!supports_responses(&Version::new(0, 13, 3))); + assert!(!supports_responses(&Version::new(0, 13, 2))); } #[test] fn supports_responses_at_or_after_cutoff() { - assert!(supports_responses(&Version::new(0, 13, 4))); + assert!(supports_responses(&Version::new(0, 13, 3))); assert!(supports_responses(&Version::new(0, 14, 0))); } }