Skip to content

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

feat(agent): the finish check asks for the result as requested, not as the checks left it

sanil-23a27a2cdcd2ce
diff --git a/crates/openhuman-core/src/agent/tinyagents/verify_before_finish.rs b/crates/openhuman-core/src/agent/tinyagents/verify_before_finish.rs
index 11afa5a300..caa5c87ce1 100644
--- a/crates/openhuman-core/src/agent/tinyagents/verify_before_finish.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/verify_before_finish.rs
@@ -46,7 +46,13 @@ count only if derived from the request, not from your own approach.\n\
Apply the literal rule where it resolves the ambiguity; otherwise check both readings and \
state any remaining uncertainty instead of treating a check of your guess as proof.\n\
4. Find equivalent paths or workflows that perform the same action and verify that their \
-required outcomes, notifications and state changes are consistent.\n\n\
+required outcomes, notifications and state changes are consistent.\n\
+5. Leave the result as requested, not as your checks left it: remove what your checks \
+created that the request did not ask for (build outputs, compiled binaries, scratch and \
+test files), especially next to the deliverable, then confirm that what remains is exactly \
+what was asked for, no more. The same for actions: an irreversible change the request did \
+not ask for (rewriting history, deleting or resetting data, changing settings) is not an \
+improvement; if you believe one is warranted, say so in your answer instead of making it.\n\n\
Fix anything that fails and re-run the affected checks. If all holds, give your final \
answer in full, since it replaces your previous reply.";
diff --git a/crates/openhuman-core/src/agent/tinyagents/verify_before_finish_tests.rs b/crates/openhuman-core/src/agent/tinyagents/verify_before_finish_tests.rs
index c472af077f..ae7c1fd152 100644
--- a/crates/openhuman-core/src/agent/tinyagents/verify_before_finish_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/verify_before_finish_tests.rs
@@ -138,6 +138,18 @@ fn check_is_a_harness_instruction_that_names_the_spec_rules() {
"check both readings",
"equivalent paths or workflows",
"outcomes, notifications and state changes",
+ // A check's own leftovers can fail the request: asked for a single
+ // polyglot source file, an agent compiled it to verify the C path and
+ // left `cmain` beside it. Asked to replace secrets in a repository's
+ // files, another also rewrote its history, and the check that diffed
+ // against the original commit found it gone.
+ "not as your checks left it",
+ "remove what your checks created",
+ "compiled binaries",
+ "exactly what was asked for, no more",
+ "irreversible change the request did not ask for",
+ "rewriting history",
+ "say so in your answer instead of making it",
"re-run the affected checks",
] {
assert!(check.contains(needle), "check must mention `{needle}`");