refactor: reorganize import statements and improve code formatting across multiple files
This commit is contained in:
@@ -3,8 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import Enum
|
||||
from typing import TYPE_CHECKING, Any
|
||||
from typing import cast
|
||||
from typing import TYPE_CHECKING, Any, cast
|
||||
from uuid import UUID
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, Query, status
|
||||
|
||||
@@ -4,11 +4,10 @@ from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
from enum import Enum
|
||||
from dataclasses import dataclass
|
||||
from datetime import UTC, datetime
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import cast
|
||||
from enum import Enum
|
||||
from typing import TYPE_CHECKING, cast
|
||||
from uuid import UUID
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, Query, Request, status
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import Enum
|
||||
from typing import TYPE_CHECKING, Literal
|
||||
from typing import cast
|
||||
from typing import TYPE_CHECKING, Literal, cast
|
||||
from uuid import UUID
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, Query, status
|
||||
|
||||
@@ -41,7 +41,9 @@ def _is_missing_gateway_agent_error(exc: OpenClawGatewayError) -> bool:
|
||||
message = str(exc).lower()
|
||||
if not message:
|
||||
return False
|
||||
if any(marker in message for marker in ("unknown agent", "no such agent", "agent does not exist")):
|
||||
if any(
|
||||
marker in message for marker in ("unknown agent", "no such agent", "agent does not exist")
|
||||
):
|
||||
return True
|
||||
return "agent" in message and "not found" in message
|
||||
|
||||
|
||||
@@ -77,7 +77,9 @@ def _is_missing_agent_error(exc: OpenClawGatewayError) -> bool:
|
||||
message = str(exc).lower()
|
||||
if not message:
|
||||
return False
|
||||
if any(marker in message for marker in ("unknown agent", "no such agent", "agent does not exist")):
|
||||
if any(
|
||||
marker in message for marker in ("unknown agent", "no such agent", "agent does not exist")
|
||||
):
|
||||
return True
|
||||
return "agent" in message and "not found" in message
|
||||
|
||||
|
||||
Reference in New Issue
Block a user