fix: prevent false timeout failures and release 1.2.2
This commit is contained in:
1 parent
1dc2b0c686
commit
e1e26772d9
18 files changed
+189
-22
No files matched your search
@@ -95,21 +95,46 @@ def failure_reason(directory: Path, status: str, recorded: str | None) -> str:
|
||||
state = read_json(directory / "status.json", {})
|
||||
if isinstance(state, dict) and state.get("error"):
|
||||
return redact(state["error"])
|
||||
log_lines: list[str] = []
|
||||
for name in ("stdout.log", "stderr.log"):
|
||||
path = directory / name
|
||||
try:
|
||||
with path.open("rb") as stream:
|
||||
stream.seek(0, 2)
|
||||
stream.seek(max(0, stream.tell() - 131072))
|
||||
lines = stream.read().decode("utf-8", errors="replace").splitlines()
|
||||
log_lines.extend(stream.read().decode("utf-8", errors="replace").splitlines())
|
||||
except OSError:
|
||||
continue
|
||||
for line in reversed(lines):
|
||||
match = re.search(r"Error running automation:\s*(.+)", line)
|
||||
if match:
|
||||
return redact(match.group(1))
|
||||
if re.search(r"(?i)(?:timeout|timed out|超时|deadline exceeded)", line):
|
||||
return redact("模型请求或任务执行超时:" + line.strip())
|
||||
for line in reversed(log_lines):
|
||||
match = re.search(r"Error running automation:\s*(.+)", line)
|
||||
if match:
|
||||
return redact(match.group(1))
|
||||
for line in reversed(log_lines):
|
||||
stripped = line.strip()
|
||||
if stripped.startswith(("⚠", "ℹ", "WARNING", "INFO", "DEBUG")):
|
||||
continue
|
||||
if any(
|
||||
name in line
|
||||
for name in (
|
||||
"VisualStepSummarizer:",
|
||||
"StepMemoryService:",
|
||||
"Could not clean unowned screen wake locks",
|
||||
)
|
||||
):
|
||||
continue
|
||||
exception_line = re.fullmatch(
|
||||
r"(?:[A-Za-z_]\w*\.)*[A-Za-z_]\w*(?:Error|Exception|Timeout):\s*.*",
|
||||
stripped,
|
||||
)
|
||||
if exception_line and not re.search(r"(?i)(?:timeout|timed out|超时)", stripped):
|
||||
return redact(stripped)
|
||||
if re.search(
|
||||
r"(?i)(?:\b(?:TimeoutError|APITimeoutError|ReadTimeout|ConnectTimeout)\s*:|"
|
||||
r"(?:模型请求|任务执行|model request|task execution).{0,100}"
|
||||
r"(?:超时|timed out|deadline exceeded))",
|
||||
stripped,
|
||||
):
|
||||
return redact("模型请求或任务执行超时:" + stripped)
|
||||
return "任务未完成,运行日志中没有可提取的具体异常;请查看执行步骤。"
|
||||
|
||||
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "artemis-showcase-ui",
|
||||
"version": "1.2.1",
|
||||
"version": "1.2.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "artemis-showcase-ui",
|
||||
"version": "1.2.1",
|
||||
"version": "1.2.2",
|
||||
"dependencies": {
|
||||
"@angular/cdk": "^22.1.5",
|
||||
"@angular/common": "^22.1.4",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "artemis-showcase-ui",
|
||||
"version": "1.2.1",
|
||||
"version": "1.2.2",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve --proxy-config proxy.conf.json",
|
||||
|
||||
Reference in new issue
Block a user