The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(claude-code): handle unclosed tool-use brackets in input builder
Steven Enamakela7f6f4614003
diff --git a/src/openhuman/inference/provider/claude_code/input_builder.rs b/src/openhuman/inference/provider/claude_code/input_builder.rsindex 137db85bbe..74639698ef 100644--- a/src/openhuman/inference/provider/claude_code/input_builder.rs+++ b/src/openhuman/inference/provider/claude_code/input_builder.rs@@ -146,6 +146,9 @@ fn content_blocks(raw: &str) -> Vec<Value> {{let start = cursor + relative;let Some(end_relative) = raw[start..].find(']') else {+ if start > cursor {+ blocks.push(json!({"type": "text", "text": &raw[cursor..start]}));+ }blocks.push(json!({"type": "text", "text": &raw[start..]}));cursor = raw.len();break;diff --git a/src/openhuman/inference/provider/claude_code/input_builder_tests.rs b/src/openhuman/inference/provider/claude_code/input_builder_tests.rsindex 4bcbbe67c5..1acc40219f 100644--- a/src/openhuman/inference/provider/claude_code/input_builder_tests.rs+++ b/src/openhuman/inference/provider/claude_code/input_builder_tests.rs@@ -58,14 +58,9 @@ fn new_session_carries_prior_turns_as_one_labelled_transcript() {let s = String::from_utf8(build_stdin(&history, true)).unwrap();let lines: Vec<_> = s.lines().collect();- // One transcript row + the latest user turn. The system row is still- // filtered out — it rides `--append-system-prompt`.- assert_eq!(- lines.len(),- 2,- "got:-{s}"- );+ // The transcript and latest prompt are content blocks in one user row.+ assert_eq!(lines.len(), 1, "got:+{s}");assert!(lines[0].contains("User: hi"));assert!(lines[0].contains("Assistant: hello"));assert!(@@ -74,8 +69,8 @@ fn new_session_carries_prior_turns_as_one_labelled_transcript() {);// The prompt itself is passed through untouched, not folded in.- let latest: Value = serde_json::from_str(lines[1]).unwrap();- assert_eq!(latest["message"]["content"][0]["text"], "how are you?");+ let latest: Value = serde_json::from_str(lines[0]).unwrap();+ assert_eq!(latest["message"]["content"][1]["text"], "how are you?");}#[test]