Skip to content

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

Merge remote-tracking branch 'upstream/main' into fix/shell-audit-no-approval-claim

M3gA-Mindcbf76114dda1
diff --cc crates/openhuman-core/src/tools/impl/system/shell.rs
index 3a92a14f21,aa2424b680..65748208d8
--- a/crates/openhuman-core/src/tools/impl/system/shell.rs
+++ b/crates/openhuman-core/src/tools/impl/system/shell.rs
@@@ -294,11 -266,21 +266,19 @@@ impl ShellTool
.and_then(|v| v.as_str())
.ok_or_else(|| anyhow::anyhow!("Missing 'command' parameter"))?;
- // Optional per-call wall-clock budget. `None`/`0` ⇒ run unbounded;
- // a positive value is clamped downstream by
- // `tool_timeout::explicit_call_timeout_*`. Shell has no default deadline
- // (issue #4023) — long scripts must run to completion.
+ // The command's deadline: in a turn, what TinyAgents' turn-budget clamp
+ // wrote (the model's own `timeout_secs` is its yield point, moved to
+ // `YIELD_AFTER_ARG` by `middleware::shell_yield`); outside a turn, the
+ // caller's. `None`/`0` ⇒ unbounded (issue #4023).
let requested_timeout = args.get("timeout_secs").and_then(|v| v.as_u64());
+ let come_back = YieldRequest::from_args(&args);
- // `approved` = the command is Prompt-class (required human approval) and
- // thus went through the harness ApprovalGate to reach here. Reads and
- // Full-mode writes run without a prompt, so they audit as approved=false
- // rather than over-claiming a human approval that never happened. (The
- // gate's exact yes/no isn't threaded into tools; this is the accurate
- // "required approval" proxy.) A command left running is audited when it
- // ends, with its real outcome.
- let approved = self.external_effect_with_args(&args);
++ // Whether a human approved the call is the harness ApprovalGate's
++ // decision, kept in its own approval record; that yes/no is not threaded
++ // into tools, so this row never claims an approval (`approved=false`).
++ // Read the gate's record for the human decision. A command left running
++ // is audited when it ends, with its real outcome.
++ let approved = false;
+ let audit = audit_once(self.audit.clone(), command.to_owned(), approved);
let start = Instant::now();
let (allowed, result) = crate::sandbox::shell_progress::with_shell_progress(
context,