Skip to content

Self-hosted AI workspace.

Python

match completion writes to requested artifact paths

pewdiepie-archdaemon1c533f9f32d4
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': '<html />'}, 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():