chore(mitc4-shell-feast-eigen-execution-prep): WIP classifier correction with full verification blocked
This commit is contained in:
+40
-1
@@ -1005,12 +1005,51 @@ class StepExecutor:
|
||||
|
||||
return output
|
||||
|
||||
@staticmethod
|
||||
def _stdout_has_helper_failure(stdout: str) -> bool:
|
||||
"""JSONL source/tool payloads are not runtime diagnostics."""
|
||||
marker = "orchestrator_helper_launch_failed"
|
||||
for line in stdout.splitlines():
|
||||
if marker not in line.lower():
|
||||
continue
|
||||
try:
|
||||
event = json.loads(line)
|
||||
except json.JSONDecodeError:
|
||||
pass
|
||||
else:
|
||||
if not isinstance(event, dict):
|
||||
continue
|
||||
if event.get("type") in {"error", "turn.failed"}:
|
||||
error = event.get("message", "") if event["type"] == "error" else event.get("error", "")
|
||||
if marker in json.dumps(error).lower():
|
||||
return True
|
||||
continue
|
||||
item = event.get("item")
|
||||
if (
|
||||
not isinstance(item, dict)
|
||||
or item.get("type") != "command_execution"
|
||||
or item.get("exit_code") in (None, 0)
|
||||
):
|
||||
continue
|
||||
line = item.get("aggregated_output", "")
|
||||
# Plain output must have a diagnostic prefix, including inside a failed command.
|
||||
if re.search(
|
||||
r"(?im)^\s*(?:(?:windows sandbox:\s*)?orchestrator_helper_launch_failed\b|"
|
||||
r"\S+\s+ERROR\b[^\r\n]*\borchestrator_helper_launch_failed\b)",
|
||||
line,
|
||||
):
|
||||
return True
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def _codex_environment_failure(output: dict) -> Optional[str]:
|
||||
diagnostic = (
|
||||
f"{output.get('stderr', '')}\n{output.get('stdout', '')}"
|
||||
).lower()
|
||||
if "orchestrator_helper_launch_failed" in diagnostic:
|
||||
if (
|
||||
"orchestrator_helper_launch_failed" in output.get("stderr", "").lower()
|
||||
or StepExecutor._stdout_has_helper_failure(output.get("stdout", ""))
|
||||
):
|
||||
return "Codex Windows sandbox helper를 실행할 수 없습니다."
|
||||
if output.get("exitCode", 0) == 0:
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user