2 Commits

Author SHA1 Message Date
dependabot[bot]
e7582abc39 chore(deps): bump lru from 0.12.5 to 0.16.2 in /llmx-rs
Bumps [lru](https://github.com/jeromefroe/lru-rs) from 0.12.5 to 0.16.2.
- [Changelog](https://github.com/jeromefroe/lru-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jeromefroe/lru-rs/compare/0.12.5...0.16.2)

---
updated-dependencies:
- dependency-name: lru
  dependency-version: 0.16.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-14 18:56:21 +00:00
67ff31104f chore: Bump version to 0.1.4
- Fix: Skip empty/whitespace text content blocks
- Fix: Validate function call arguments and skip malformed calls
- Fix: Skip outputs for skipped function calls to maintain consistency
- Resolves Anthropic API errors:
  - "messages: text content blocks must contain non-whitespace text"
  - "Extra data: line 1 column 26 (char 25)" (invalid JSON)
  - "unexpected `tool_use_id` found in `tool_result` blocks"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 19:52:13 +01:00
12 changed files with 94 additions and 56 deletions

108
llmx-rs/Cargo.lock generated
View File

@@ -178,7 +178,7 @@ checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
[[package]]
name = "app_test_support"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"assert_cmd",
@@ -945,7 +945,7 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "core_test_support"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"assert_cmd",
@@ -1756,6 +1756,12 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
[[package]]
name = "foldhash"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
[[package]]
name = "foreign-types"
version = "0.3.2"
@@ -2028,7 +2034,7 @@ checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5"
dependencies = [
"allocator-api2",
"equivalent",
"foldhash",
"foldhash 0.1.5",
]
[[package]]
@@ -2036,6 +2042,11 @@ name = "hashbrown"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d"
dependencies = [
"allocator-api2",
"equivalent",
"foldhash 0.2.0",
]
[[package]]
name = "heck"
@@ -2822,7 +2833,7 @@ checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956"
[[package]]
name = "llmx-ansi-escape"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"ansi-to-tui",
"ratatui",
@@ -2831,7 +2842,7 @@ dependencies = [
[[package]]
name = "llmx-app-server"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"app_test_support",
@@ -2866,7 +2877,7 @@ dependencies = [
[[package]]
name = "llmx-app-server-protocol"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"clap",
@@ -2884,7 +2895,7 @@ dependencies = [
[[package]]
name = "llmx-apply-patch"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"assert_cmd",
@@ -2899,7 +2910,7 @@ dependencies = [
[[package]]
name = "llmx-arg0"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"dotenvy",
@@ -2912,7 +2923,7 @@ dependencies = [
[[package]]
name = "llmx-async-utils"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"async-trait",
"pretty_assertions",
@@ -2936,7 +2947,7 @@ dependencies = [
[[package]]
name = "llmx-backend-openapi-models"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"serde",
"serde_json",
@@ -2945,7 +2956,7 @@ dependencies = [
[[package]]
name = "llmx-chatgpt"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"clap",
@@ -2960,7 +2971,7 @@ dependencies = [
[[package]]
name = "llmx-cli"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"assert_cmd",
@@ -3000,7 +3011,7 @@ dependencies = [
[[package]]
name = "llmx-cloud-tasks"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"async-trait",
@@ -3026,7 +3037,7 @@ dependencies = [
[[package]]
name = "llmx-cloud-tasks-client"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"async-trait",
@@ -3041,7 +3052,7 @@ dependencies = [
[[package]]
name = "llmx-common"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"clap",
"llmx-app-server-protocol",
@@ -3053,7 +3064,7 @@ dependencies = [
[[package]]
name = "llmx-core"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"askama",
@@ -3134,7 +3145,7 @@ dependencies = [
[[package]]
name = "llmx-exec"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"assert_cmd",
@@ -3167,7 +3178,7 @@ dependencies = [
[[package]]
name = "llmx-execpolicy"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"allocative",
"anyhow",
@@ -3187,7 +3198,7 @@ dependencies = [
[[package]]
name = "llmx-feedback"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"llmx-protocol",
@@ -3198,7 +3209,7 @@ dependencies = [
[[package]]
name = "llmx-file-search"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"clap",
@@ -3211,7 +3222,7 @@ dependencies = [
[[package]]
name = "llmx-git"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"assert_matches",
"once_cell",
@@ -3227,7 +3238,7 @@ dependencies = [
[[package]]
name = "llmx-keyring-store"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"keyring",
"tracing",
@@ -3235,7 +3246,7 @@ dependencies = [
[[package]]
name = "llmx-linux-sandbox"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"clap",
"landlock",
@@ -3248,7 +3259,7 @@ dependencies = [
[[package]]
name = "llmx-login"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"base64",
@@ -3272,7 +3283,7 @@ dependencies = [
[[package]]
name = "llmx-mcp-server"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"assert_cmd",
@@ -3299,7 +3310,7 @@ dependencies = [
[[package]]
name = "llmx-ollama"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"assert_matches",
"async-stream",
@@ -3315,7 +3326,7 @@ dependencies = [
[[package]]
name = "llmx-otel"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"chrono",
"eventsource-stream",
@@ -3336,14 +3347,14 @@ dependencies = [
[[package]]
name = "llmx-process-hardening"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"libc",
]
[[package]]
name = "llmx-protocol"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"base64",
@@ -3369,7 +3380,7 @@ dependencies = [
[[package]]
name = "llmx-responses-api-proxy"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"clap",
@@ -3385,7 +3396,7 @@ dependencies = [
[[package]]
name = "llmx-rmcp-client"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"axum",
@@ -3414,7 +3425,7 @@ dependencies = [
[[package]]
name = "llmx-stdio-to-uds"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"assert_cmd",
@@ -3425,7 +3436,7 @@ dependencies = [
[[package]]
name = "llmx-tui"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"arboard",
@@ -3490,16 +3501,16 @@ dependencies = [
[[package]]
name = "llmx-utils-cache"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"lru",
"lru 0.16.2",
"sha1",
"tokio",
]
[[package]]
name = "llmx-utils-image"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"base64",
"image",
@@ -3511,7 +3522,7 @@ dependencies = [
[[package]]
name = "llmx-utils-json-to-toml"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"pretty_assertions",
"serde_json",
@@ -3520,7 +3531,7 @@ dependencies = [
[[package]]
name = "llmx-utils-pty"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"portable-pty",
@@ -3529,7 +3540,7 @@ dependencies = [
[[package]]
name = "llmx-utils-readiness"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"assert_matches",
"async-trait",
@@ -3540,11 +3551,11 @@ dependencies = [
[[package]]
name = "llmx-utils-string"
version = "0.1.2"
version = "0.1.4"
[[package]]
name = "llmx-utils-tokenizer"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"pretty_assertions",
@@ -3613,6 +3624,15 @@ dependencies = [
"hashbrown 0.15.4",
]
[[package]]
name = "lru"
version = "0.16.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96051b46fc183dc9cd4a223960ef37b9af631b55191852a8274bfef064cda20f"
dependencies = [
"hashbrown 0.16.0",
]
[[package]]
name = "lru-slab"
version = "0.1.2"
@@ -3655,7 +3675,7 @@ checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3"
[[package]]
name = "mcp-types"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"schemars 0.8.22",
"serde",
@@ -3665,7 +3685,7 @@ dependencies = [
[[package]]
name = "mcp_test_support"
version = "0.1.2"
version = "0.1.4"
dependencies = [
"anyhow",
"assert_cmd",
@@ -4848,7 +4868,7 @@ dependencies = [
"indoc",
"instability",
"itertools 0.13.0",
"lru",
"lru 0.12.5",
"paste",
"strum 0.26.3",
"unicode-segmentation",

View File

@@ -43,7 +43,7 @@ members = [
resolver = "2"
[workspace.package]
version = "0.1.3"
version = "0.1.4"
# 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
@@ -135,7 +135,7 @@ landlock = "0.4.1"
lazy_static = "1"
libc = "0.2.175"
log = "0.4"
lru = "0.12.5"
lru = "0.16.2"
maplit = "1.0.2"
mime_guess = "2.0.5"
multimap = "0.10.0"

View File

@@ -138,7 +138,7 @@ impl McpProcess {
client_info: ClientInfo {
name: "llmx-app-server-tests".to_string(),
title: None,
version: "0.1.3".to_string(),
version: "0.1.4".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.3 ({} {}; {}) {} (llmx-app-server-tests; 0.1.3)",
"llmx_cli_rs/0.1.4 ({} {}; {}) {} (llmx-app-server-tests; 0.1.4)",
os_info.os_type(),
os_info.version(),
os_info.architecture().unwrap_or("unknown"),

View File

@@ -161,6 +161,9 @@ pub(crate) async fn stream_chat_completions(
// aggregated assistant message was recorded alongside an earlier partial).
let mut last_assistant_text: Option<String> = None;
// Track call_ids of skipped function calls so we can also skip their outputs
let mut skipped_call_ids: std::collections::HashSet<String> = std::collections::HashSet::new();
for (idx, item) in input.iter().enumerate() {
match item {
ResponseItem::Message { role, content, .. } => {
@@ -227,6 +230,15 @@ pub(crate) async fn stream_chat_completions(
call_id,
..
} => {
// Validate that arguments is valid JSON before sending to API
// If invalid, skip this function call to avoid API errors
if serde_json::from_str::<serde_json::Value>(arguments).is_err() {
debug!("Skipping malformed function call with invalid JSON arguments: {}", arguments);
// Track this call_id so we can also skip its corresponding output
skipped_call_ids.insert(call_id.clone());
continue;
}
let mut msg = json!({
"role": "assistant",
"content": null,
@@ -271,6 +283,12 @@ pub(crate) async fn stream_chat_completions(
messages.push(msg);
}
ResponseItem::FunctionCallOutput { call_id, output } => {
// Skip outputs for function calls that were skipped due to malformed arguments
if skipped_call_ids.contains(call_id) {
debug!("Skipping function call output for skipped call_id: {}", call_id);
continue;
}
// Prefer structured content items when available (e.g., images)
// otherwise fall back to the legacy plain-string content.
let content_value = if let Some(items) = &output.content_items {

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.3 ({} {}; {}) {} (elicitation test; 0.0.0)",
"llmx_cli_rs/0.1.4 ({} {}; {}) {} (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.3",
"version": "0.1.4",
"user_agent": user_agent
},
"protocolVersion": mcp_types::MCP_SCHEMA_VERSION

View File

@@ -5,7 +5,7 @@ expression: sanitized
/status
╭───────────────────────────────────────────────────────────────────────────╮
│ >_ LLMX (v0.1.3) │
│ >_ LLMX (v0.1.4) │
│ │
│ 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.3) │
│ >_ LLMX (v0.1.4) │
│ │
│ 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.3) │
│ >_ LLMX (v0.1.4) │
│ │
│ 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.3) │
│ >_ LLMX (v0.1.4) │
│ │
│ 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.3) │
│ >_ LLMX (v0.1.4) │
│ │
│ 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.3) │
│ >_ LLMX (v0.1.4) │
│ │
│ Visit https://chatgpt.com/llmx/settings/ │
│ usage for up-to-date │