Release: gateway approval_id fallback (#6168) + update-check guard (#6180) + state-dir test isolation (#6305) (#6332)
* fix: catch unhandled exception in POST /api/updates/check (defensive hardening) (#6180) * fix: generate non-empty approval_id when gateway approval.request omits it (#6008) (#6168) * chore: mark update-check try/except as defensive-only guard, drop #6086 linkage Per maintainer review, the try/except wrapper is defense-in-depth only — it does NOT fix #6086 (root cause is signal/process-group reaping). Updated log message and added inline comment to make this explicit. Leave #6086 open. * test: isolate state-dir probes from user state * docs(changelog): stamp #6168 approval_id, #6180 update-check guard, #6305 test isolation --------- Co-authored-by: webtecnica <75556242+webtecnica@users.noreply.github.com> Co-authored-by: webtecnica <webtecnica@users.noreply.github.com> Co-authored-by: pxxD1998 <214340659+pxxD1998@users.noreply.github.com> Co-authored-by: nesquena-hermes <agent@nesquena-hermes>
This commit is contained in:
4 files changed
+76
-15
No files matched your search
@@ -6,6 +6,7 @@ import logging
|
||||
import os
|
||||
import threading
|
||||
import time
|
||||
import uuid
|
||||
import urllib.error
|
||||
import urllib.request
|
||||
from typing import Any
|
||||
@@ -336,6 +337,8 @@ def _gateway_runs_approval_event(payload: dict) -> dict | None:
|
||||
args = payload.get("args") if isinstance(payload.get("args"), (list, dict)) else []
|
||||
run_id = str(payload.get("run_id") or "").strip()
|
||||
approval_id = str(payload.get("approval_id") or payload.get("id") or "").strip()
|
||||
if not approval_id:
|
||||
approval_id = uuid.uuid4().hex
|
||||
risk = str(payload.get("risk_level") or "high").strip()
|
||||
choices = payload.get("choices") if isinstance(payload.get("choices"), list) else []
|
||||
allow_permanent = payload.get("allow_permanent")
|
||||
|
||||
+11
-1
@@ -13907,7 +13907,17 @@ def handle_post(handler, parsed) -> bool:
|
||||
channel = settings.get("update_channel")
|
||||
from api.updates import check_for_updates
|
||||
|
||||
return j(handler, check_for_updates(force=force, include_agent=include_agent_updates, channel=channel))
|
||||
logger.info("checking for updates (force=%s, include_agent=%s, channel=%s)", force, include_agent_updates, channel)
|
||||
# Defensive-only guard: wrap check_for_updates() for consistent
|
||||
# exception protection across all route handlers. Does NOT fix #6086
|
||||
# (root cause is likely signal/process-group reaping, per maintainer analysis).
|
||||
try:
|
||||
payload = check_for_updates(force=force, include_agent=include_agent_updates, channel=channel)
|
||||
except Exception:
|
||||
logger.exception("update check failed unexpectedly (defensive guard caught exception)")
|
||||
return bad(handler, "Update check failed, see server log for details", status=500)
|
||||
logger.info("update check completed")
|
||||
return j(handler, payload)
|
||||
|
||||
if parsed.path == "/api/extensions/toggle":
|
||||
from api.extensions import ExtensionToggleError, set_extension_user_enabled
|
||||
|
||||
Reference in new issue
Block a user