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(agent): don't run required-output repair on a paused clarification turn\n\nThe early-exit branch this branch added silently joined the required-output\nenforcement path, whose own comment still enumerated the three branches that\nexisted before it.\n\nFor an agent carrying a `required_output` contract, a turn paused on\n`ask_user_clarification` delivers the question as its reply. The question does\nnot carry the required block, so `enforce_required_output` spends a repair\nmodel call rewriting it, and `replace_last_assistant_reply` persists the\nrewrite — so the question in the transcript stops matching the one the user is\nlooking at, and is billed for.\n\nA paused turn delivers no reply for downstream parsing to depend on. The\ncontract applies to the answer the agent gives once the user has replied, not\nto the asking. Skip enforcement when `early_exit_tool` is set, and say so where\nthe branches are enumerated.\n\nRaised by @coderabbitai in review.\n\nNot covered by a test: this is the chat/session path, whose missing scripted\nsession-turn harness is already disclosed in the PR body. The guard is a\none-line decision on a path no existing test reaches, and building that harness\nto cover it is a larger piece of work than this PR should absorb.\n\nClaude-Session: https://claude.ai/code/session_01Fu3PXYSu3gV9u9kV6CwH1G\n
M3gA-Mind700579099cfe
diff --git a/src/openhuman/agent/harness/session/turn/core_session_part_01.rs b/src/openhuman/agent/harness/session/turn/core_session_part_01.rsindex 5bbba62f1f..a304e31ecd 100644--- a/src/openhuman/agent/harness/session/turn/core_session_part_01.rs+++ b/src/openhuman/agent/harness/session/turn/core_session_part_01.rs@@ -390,9 +390,9 @@ impl Agent {};// Enforce the required structured-output contract (issue #4117) on the- // accepted reply — for ALL of the branches above (normal finish, cap- // checkpoint, #4093 synthesized close), since each delivers a reply- // downstream parsing depends on. When this agent must emit a JSON block+ // accepted reply — for the branches above that actually deliver one+ // (normal finish, cap checkpoint, #4093 synthesized close), since each+ // is a reply downstream parsing depends on. When this agent must emit a JSON block// every turn and the reply omitted it, validate-and-repair before the// turn is accepted, reconciling with streaming (append-only when a live// stream is attached, replace otherwise — see `enforce_required_output`).@@ -403,12 +403,25 @@ impl Agent {// helpers below are part of the runtime slated to move into TinyAgents// and so speak the crate type, while the session still holds the host's// `AgentConfig`. See `tinyagents::config::required_output_from`.- let reply = if let Some(contract) = self- .config- .required_output- .as_ref()- .map(crate::openhuman::agent::tinyagents::config::required_output_from)- {+ //+ // NOT for a turn paused on `ask_user_clarification`. The reply there is+ // the question itself, which will not carry the required block, so+ // enforcement would spend a repair model call rewriting the very text+ // the user is being asked to answer — and `replace_last_assistant_reply`+ // would persist the rewrite, so the question in the transcript would+ // stop matching the one on screen. A paused turn delivers no reply for+ // downstream parsing to depend on; the contract applies to the answer+ // this agent gives after the user replies, not to the asking (#6213+ // review).+ let required_output = if outcome.early_exit_tool.is_some() {+ None+ } else {+ self.config+ .required_output+ .as_ref()+ .map(crate::openhuman::agent::tinyagents::config::required_output_from)+ };+ let reply = if let Some(contract) = required_output {match self.enforce_required_output(&reply,