fix(agent): discard truncated tool calls when finish_reason == Length (#1631) (#1632)

This commit is contained in:
rajulbhatnagar
2026-03-26 10:02:41 +03:00
committed by GitHub
parent b3fbef5287
commit ed4d92932a
5 changed files with 239 additions and 4 deletions
+2
View File
@@ -1158,6 +1158,7 @@ impl<'a> JobDelegate<'a> {
Ok(crate::llm::RespondOutput {
result: RespondResult::Text(String::new()),
usage: crate::llm::TokenUsage::default(),
finish_reason: crate::llm::FinishReason::Stop,
})
}
}
@@ -1283,6 +1284,7 @@ impl<'a> LoopDelegate for JobDelegate<'a> {
content: reasoning_text,
},
usage: crate::llm::TokenUsage::default(),
finish_reason: crate::llm::FinishReason::ToolUse,
});
}
Ok(_) => {} // empty selections, fall through