From 1c533f9f32d467f92a1f3cc47ecc8258243ffcd3 Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Thu, 17 Sep 2026 23:29:44 +0000 Subject: [PATCH] match completion writes to requested artifact paths --- src/clean_agent_preview.py | 2 -- tests/test_clean_agent_preview.py | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/clean_agent_preview.py b/src/clean_agent_preview.py index a5a83e824..0a246a2eb 100644 --- a/src/clean_agent_preview.py +++ b/src/clean_agent_preview.py @@ -1374,8 +1374,6 @@ def runtime_required_artifacts(user_text, client_runtime_context): def execution_targets_required_artifact(tool_name, arguments, required_artifacts): """Return true only when a successful mutation names a required output.""" - if canonical(tool_name) == 'write_file': - return True serialized = ( arguments if isinstance(arguments, str) else json.dumps(arguments or {}, ensure_ascii=False) diff --git a/tests/test_clean_agent_preview.py b/tests/test_clean_agent_preview.py index 2bfa595b4..bfd2ce3c4 100644 --- a/tests/test_clean_agent_preview.py +++ b/tests/test_clean_agent_preview.py @@ -466,6 +466,9 @@ def test_read_only_python_does_not_satisfy_required_artifact(): assert execution_targets_required_artifact( 'write_file', {'path': '/workspace/output.html', 'content': ''}, required, ) + assert not execution_targets_required_artifact( + 'write_file', {'path': '/workspace/analyze.py', 'content': 'print(1)'}, required, + ) def test_read_only_gate_blocks_mutation_and_network_shell():