Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(session_host): reuse close verdict parsing from tinyagents harness

Steven Enamakel9b8d81e055d9
diff --git a/crates/openhuman-core/src/agent/session_host/turn_checkpoint.rs b/crates/openhuman-core/src/agent/session_host/turn_checkpoint.rs
index 5a4788ce64..9183279ab0 100644
--- a/crates/openhuman-core/src/agent/session_host/turn_checkpoint.rs
+++ b/crates/openhuman-core/src/agent/session_host/turn_checkpoint.rs
@@ -530,27 +530,7 @@ pub(crate) fn close_verification_prompt(user_request: &str, records: &str, reply
/// The check call's verdict on a closing message.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-pub(crate) enum CloseVerdict {
- Accept,
- Reject,
- /// Neither word found (or the call failed). The reply is unverified, so the
- /// caller does not ship it and uses the deterministic fallback instead.
- Unclear,
-}
-
-/// Read the verdict from the check call's text: the **last** standalone
-/// `ACCEPT`/`REJECT` token wins, so a model that reasons aloud before its
-/// answer is read by its conclusion, and `UNACCEPTABLE` is not an `ACCEPT`.
-pub(crate) fn parse_close_verdict(text: &str) -> CloseVerdict {
- text.split(|c: char| !c.is_ascii_alphabetic())
- .filter_map(|token| match token.to_ascii_uppercase().as_str() {
- "ACCEPT" => Some(CloseVerdict::Accept),
- "REJECT" => Some(CloseVerdict::Reject),
- _ => None,
- })
- .next_back()
- .unwrap_or(CloseVerdict::Unclear)
-}
+pub(crate) use tinyagents_harness::close::{CloseVerdict, parse_close_verdict};
/// Build a deterministic final answer from this turn's tool results.
/// Used as the guaranteed non-empty fallback when a turn ran tools but the