checkpoint: finished test curation

This commit is contained in:
2026-02-25 21:58:18 -05:00
parent e0b9ab997a
commit 56025a84e9
33 changed files with 546 additions and 356 deletions

View File

@@ -18,6 +18,20 @@ def main():
if "run" not in sys.argv:
return
# If the prompt contains tool results (indicated by "role": "tool"),
# it means we are in the second round and should provide a final answer.
if '"role": "tool"' in prompt:
print(json.dumps({
"type": "message",
"text": "I have processed the tool results. Everything looks good!"
}), flush=True)
print(json.dumps({
"type": "result",
"usage": {"total_tokens": 100},
"session_id": "mock-session-final"
}), flush=True)
return
# Simulate the 'BeforeTool' hook by calling the bridge directly.
bridge_path = os.path.abspath("scripts/cli_tool_bridge.py")
@@ -35,7 +49,8 @@ def main():
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True
text=True,
env=os.environ # Ensure environment variables are inherited
)
stdout, stderr = process.communicate(input=json.dumps(tool_call))
@@ -70,11 +85,11 @@ def main():
}), flush=True)
else:
print(json.dumps({
"type": "message",
"type": "message",
"text": f"Tool execution was denied. Decision: {decision}"
}), flush=True)
print(json.dumps({
"type": "result",
"type": "result",
"usage": {"total_tokens": 10},
"session_id": "mock-session-denied"
}), flush=True)