chore: Bump version to 0.1.3

- 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 <noreply@anthropic.com>
This commit is contained in:
2025-11-14 14:30:46 +01:00
parent 4b2e4a1d48
commit 866ca2a372
11 changed files with 20 additions and 12 deletions

View File

@@ -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

View File

@@ -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?;

View File

@@ -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"),

View File

@@ -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

View File

@@ -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

View File

@@ -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 │

View File

@@ -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 │

View File

@@ -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 │

View File

@@ -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 │

View File

@@ -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 │

View File

@@ -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 │