27 lines
1.6 KiB
Diff
27 lines
1.6 KiB
Diff
--- a/runner/core.py
|
|
+++ b/runner/core.py
|
|
@@ -107,12 +107,22 @@
|
|
require(not event.get("error"), "Antigravity provider error")
|
|
step = event.get("step_update")
|
|
require(isinstance(step, dict), "Antigravity malformed step")
|
|
- require(step.get("step_type") in ("tool", "agent_response", "checkpoint", "finish")
|
|
+ require(step.get("step_type") in ("user_input", "tool", "agent_response", "checkpoint", "finish")
|
|
and step.get("state") in ("ACTIVE", "DONE", "ERROR"), "Antigravity unknown step")
|
|
require(not step.get("error"), "Antigravity provider error")
|
|
+ if step.get("step_type") == "user_input":
|
|
+ require(step.get("state") == "DONE" and "tool_info" not in step
|
|
+ and "error" not in step and type(step.get("step_index")) is int
|
|
+ and step["step_index"] == 0, "Antigravity malformed user input")
|
|
+ continue
|
|
info = step.get("tool_info", {})
|
|
require(isinstance(info, dict), "Antigravity malformed tool")
|
|
error = info.get("error")
|
|
+ if info.get("name") == "run_command" and "output" in info:
|
|
+ output = info["output"]
|
|
+ require(isinstance(output, str), "Antigravity malformed shell output")
|
|
+ require(not re.search(r"(?im)^\s*(?:sandbox-exec: sandbox_apply: Operation not permitted|(?:error: )?(?:permission denied|operation not permitted|access denied))\s*$", output),
|
|
+ "Antigravity shell permission denied")
|
|
if error is None:
|
|
require(step.get("state") not in ("ERROR", "FAILED", "CANCELLED"), "Antigravity failed step")
|
|
continue
|