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 __future__ import annotations
|
||||||
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import TYPE_CHECKING, Any
|
from typing import TYPE_CHECKING, Any, cast
|
||||||
from typing import cast
|
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from fastapi import APIRouter, Depends, HTTPException, Query, status
|
from fastapi import APIRouter, Depends, HTTPException, Query, status
|
||||||
|
|||||||
@@ -4,11 +4,10 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import json
|
import json
|
||||||
from enum import Enum
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from datetime import UTC, datetime
|
from datetime import UTC, datetime
|
||||||
from typing import TYPE_CHECKING
|
from enum import Enum
|
||||||
from typing import cast
|
from typing import TYPE_CHECKING, cast
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from fastapi import APIRouter, Depends, HTTPException, Query, Request, status
|
from fastapi import APIRouter, Depends, HTTPException, Query, Request, status
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import TYPE_CHECKING, Literal
|
from typing import TYPE_CHECKING, Literal, cast
|
||||||
from typing import cast
|
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
from fastapi import APIRouter, Depends, HTTPException, Query, status
|
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()
|
message = str(exc).lower()
|
||||||
if not message:
|
if not message:
|
||||||
return False
|
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 True
|
||||||
return "agent" in message and "not found" in message
|
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()
|
message = str(exc).lower()
|
||||||
if not message:
|
if not message:
|
||||||
return False
|
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 True
|
||||||
return "agent" in message and "not found" in message
|
return "agent" in message and "not found" in message
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ from uuid import uuid4
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from app.api import boards
|
|
||||||
import app.services.board_lifecycle as board_lifecycle
|
import app.services.board_lifecycle as board_lifecycle
|
||||||
|
from app.api import boards
|
||||||
from app.models.boards import Board
|
from app.models.boards import Board
|
||||||
from app.services.openclaw.gateway_rpc import OpenClawGatewayError
|
from app.services.openclaw.gateway_rpc import OpenClawGatewayError
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,6 @@ def test_heartbeat_templates_fit_in_injected_context_limit() -> None:
|
|||||||
)
|
)
|
||||||
for name in targets:
|
for name in targets:
|
||||||
size = (TEMPLATES_DIR / name).stat().st_size
|
size = (TEMPLATES_DIR / name).stat().st_size
|
||||||
assert size <= HEARTBEAT_CONTEXT_LIMIT, (
|
assert (
|
||||||
f"{name} is {size} chars (limit {HEARTBEAT_CONTEXT_LIMIT})"
|
size <= HEARTBEAT_CONTEXT_LIMIT
|
||||||
)
|
), f"{name} is {size} chars (limit {HEARTBEAT_CONTEXT_LIMIT})"
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export interface BoardRead {
|
|||||||
require_approval_for_done?: boolean;
|
require_approval_for_done?: boolean;
|
||||||
require_review_before_done?: boolean;
|
require_review_before_done?: boolean;
|
||||||
block_status_changes_with_pending_approval?: boolean;
|
block_status_changes_with_pending_approval?: boolean;
|
||||||
|
only_lead_can_change_status?: boolean;
|
||||||
id: string;
|
id: string;
|
||||||
organization_id: string;
|
organization_id: string;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
|
|||||||
@@ -24,4 +24,5 @@ export interface BoardUpdate {
|
|||||||
require_approval_for_done?: boolean | null;
|
require_approval_for_done?: boolean | null;
|
||||||
require_review_before_done?: boolean | null;
|
require_review_before_done?: boolean | null;
|
||||||
block_status_changes_with_pending_approval?: boolean | null;
|
block_status_changes_with_pending_approval?: boolean | null;
|
||||||
|
only_lead_can_change_status?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user