From 866ca2a37268cbc4017b0dfdb304918aec662bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Fri, 14 Nov 2025 14:30:46 +0100 Subject: [PATCH] chore: Bump version to 0.1.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix: Skip empty/whitespace-only text content blocks in chat completions - This resolves Anthropic API errors: - "messages: text content blocks must contain non-whitespace text" - "messages: text content blocks must be non-empty" - Updated version strings in all test files and snapshots 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- llmx-rs/Cargo.toml | 2 +- llmx-rs/app-server/tests/common/mcp_process.rs | 2 +- llmx-rs/app-server/tests/suite/user_agent.rs | 2 +- llmx-rs/core/src/chat_completions.rs | 10 +++++++++- llmx-rs/mcp-server/tests/common/mcp_process.rs | 4 ++-- ..._tests__status_snapshot_includes_monthly_limit.snap | 2 +- ...ts__status_snapshot_includes_reasoning_details.snap | 2 +- ...ts__status_snapshot_shows_empty_limits_message.snap | 2 +- ...__status_snapshot_shows_missing_limits_message.snap | 2 +- ...ts__status_snapshot_shows_stale_limits_message.snap | 2 +- ...__status_snapshot_truncates_in_narrow_terminal.snap | 2 +- 11 files changed, 20 insertions(+), 12 deletions(-) diff --git a/llmx-rs/Cargo.toml b/llmx-rs/Cargo.toml index ea2f3fb7..729c222f 100644 --- a/llmx-rs/Cargo.toml +++ b/llmx-rs/Cargo.toml @@ -43,7 +43,7 @@ members = [ resolver = "2" [workspace.package] -version = "0.1.2" +version = "0.1.3" # Track the edition for all workspace crates in one place. Individual # crates can still override this value, but keeping it here means new # crates created with `cargo new -w ...` automatically inherit the 2024 diff --git a/llmx-rs/app-server/tests/common/mcp_process.rs b/llmx-rs/app-server/tests/common/mcp_process.rs index 00674f88..493ef18c 100644 --- a/llmx-rs/app-server/tests/common/mcp_process.rs +++ b/llmx-rs/app-server/tests/common/mcp_process.rs @@ -138,7 +138,7 @@ impl McpProcess { client_info: ClientInfo { name: "llmx-app-server-tests".to_string(), title: None, - version: "0.1.2".to_string(), + version: "0.1.3".to_string(), }, })?); let req_id = self.send_request("initialize", params).await?; diff --git a/llmx-rs/app-server/tests/suite/user_agent.rs b/llmx-rs/app-server/tests/suite/user_agent.rs index f34fa5c7..a1f9b8f3 100644 --- a/llmx-rs/app-server/tests/suite/user_agent.rs +++ b/llmx-rs/app-server/tests/suite/user_agent.rs @@ -26,7 +26,7 @@ async fn get_user_agent_returns_current_llmx_user_agent() -> Result<()> { let os_info = os_info::get(); let user_agent = format!( - "llmx_cli_rs/0.1.2 ({} {}; {}) {} (llmx-app-server-tests; 0.1.2)", + "llmx_cli_rs/0.1.3 ({} {}; {}) {} (llmx-app-server-tests; 0.1.3)", os_info.os_type(), os_info.version(), os_info.architecture().unwrap_or("unknown"), diff --git a/llmx-rs/core/src/chat_completions.rs b/llmx-rs/core/src/chat_completions.rs index 84c36c14..10b708ca 100644 --- a/llmx-rs/core/src/chat_completions.rs +++ b/llmx-rs/core/src/chat_completions.rs @@ -175,7 +175,10 @@ pub(crate) async fn stream_chat_completions( ContentItem::InputText { text: t } | ContentItem::OutputText { text: t } => { text.push_str(t); - items.push(json!({"type":"text","text": t})); + // Only add text content blocks that are non-empty + if !t.trim().is_empty() { + items.push(json!({"type":"text","text": t})); + } } ContentItem::InputImage { image_url } => { saw_image = true; @@ -184,6 +187,11 @@ pub(crate) async fn stream_chat_completions( } } + // Skip messages with empty or whitespace-only text content (unless they contain images) + if text.trim().is_empty() && !saw_image { + continue; + } + // Skip exact-duplicate assistant messages. if role == "assistant" { if let Some(prev) = &last_assistant_text diff --git a/llmx-rs/mcp-server/tests/common/mcp_process.rs b/llmx-rs/mcp-server/tests/common/mcp_process.rs index 0379e157..db7e140d 100644 --- a/llmx-rs/mcp-server/tests/common/mcp_process.rs +++ b/llmx-rs/mcp-server/tests/common/mcp_process.rs @@ -144,7 +144,7 @@ impl McpProcess { let initialized = self.read_jsonrpc_message().await?; let os_info = os_info::get(); let user_agent = format!( - "llmx_cli_rs/0.1.2 ({} {}; {}) {} (elicitation test; 0.0.0)", + "llmx_cli_rs/0.1.3 ({} {}; {}) {} (elicitation test; 0.0.0)", os_info.os_type(), os_info.version(), os_info.architecture().unwrap_or("unknown"), @@ -163,7 +163,7 @@ impl McpProcess { "serverInfo": { "name": "llmx-mcp-server", "title": "LLMX", - "version": "0.1.2", + "version": "0.1.3", "user_agent": user_agent }, "protocolVersion": mcp_types::MCP_SCHEMA_VERSION diff --git a/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_includes_monthly_limit.snap b/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_includes_monthly_limit.snap index 6c5903f6..65566e5d 100644 --- a/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_includes_monthly_limit.snap +++ b/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_includes_monthly_limit.snap @@ -5,7 +5,7 @@ expression: sanitized /status ╭───────────────────────────────────────────────────────────────────────────╮ -│ >_ LLMX (v0.1.2) │ +│ >_ LLMX (v0.1.3) │ │ │ │ Visit https://chatgpt.com/llmx/settings/usage for up-to-date │ │ information on rate limits and credits │ diff --git a/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_includes_reasoning_details.snap b/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_includes_reasoning_details.snap index f210055a..87f0bd7d 100644 --- a/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_includes_reasoning_details.snap +++ b/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_includes_reasoning_details.snap @@ -5,7 +5,7 @@ expression: sanitized /status ╭─────────────────────────────────────────────────────────────────╮ -│ >_ LLMX (v0.1.2) │ +│ >_ LLMX (v0.1.3) │ │ │ │ Visit https://chatgpt.com/llmx/settings/usage for up-to-date │ │ information on rate limits and credits │ diff --git a/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_shows_empty_limits_message.snap b/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_shows_empty_limits_message.snap index 2a544ea1..2cfce215 100644 --- a/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_shows_empty_limits_message.snap +++ b/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_shows_empty_limits_message.snap @@ -5,7 +5,7 @@ expression: sanitized /status ╭──────────────────────────────────────────────────────────────╮ -│ >_ LLMX (v0.1.2) │ +│ >_ LLMX (v0.1.3) │ │ │ │ Visit https://chatgpt.com/llmx/settings/usage for up-to-date │ │ information on rate limits and credits │ diff --git a/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_shows_missing_limits_message.snap b/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_shows_missing_limits_message.snap index 2a544ea1..2cfce215 100644 --- a/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_shows_missing_limits_message.snap +++ b/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_shows_missing_limits_message.snap @@ -5,7 +5,7 @@ expression: sanitized /status ╭──────────────────────────────────────────────────────────────╮ -│ >_ LLMX (v0.1.2) │ +│ >_ LLMX (v0.1.3) │ │ │ │ Visit https://chatgpt.com/llmx/settings/usage for up-to-date │ │ information on rate limits and credits │ diff --git a/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_shows_stale_limits_message.snap b/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_shows_stale_limits_message.snap index 3767828b..9ec72123 100644 --- a/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_shows_stale_limits_message.snap +++ b/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_shows_stale_limits_message.snap @@ -5,7 +5,7 @@ expression: sanitized /status ╭───────────────────────────────────────────────────────────────────╮ -│ >_ LLMX (v0.1.2) │ +│ >_ LLMX (v0.1.3) │ │ │ │ Visit https://chatgpt.com/llmx/settings/usage for up-to-date │ │ information on rate limits and credits │ diff --git a/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_truncates_in_narrow_terminal.snap b/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_truncates_in_narrow_terminal.snap index 9cff6385..50632973 100644 --- a/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_truncates_in_narrow_terminal.snap +++ b/llmx-rs/tui/src/status/snapshots/llmx_tui__status__tests__status_snapshot_truncates_in_narrow_terminal.snap @@ -5,7 +5,7 @@ expression: sanitized /status ╭────────────────────────────────────────────╮ -│ >_ LLMX (v0.1.2) │ +│ >_ LLMX (v0.1.3) │ │ │ │ Visit https://chatgpt.com/llmx/settings/ │ │ usage for up-to-date │