From 9a5964a31cebe76cd3a1ba2c3d60b72e42e47448 Mon Sep 17 00:00:00 2001 From: Abhimanyu Saharan Date: Fri, 13 Feb 2026 16:22:00 +0530 Subject: [PATCH] refactor: reorganize import statements and improve code formatting across multiple files --- backend/app/api/agent.py | 3 +-- backend/app/api/board_group_memory.py | 5 ++--- backend/app/api/boards.py | 3 +-- backend/app/services/board_lifecycle.py | 4 +++- backend/app/services/openclaw/provisioning.py | 4 +++- backend/tests/test_boards_delete.py | 2 +- backend/tests/test_template_size_budget.py | 6 +++--- frontend/src/api/generated/model/boardRead.ts | 1 + frontend/src/api/generated/model/boardUpdate.ts | 1 + 9 files changed, 16 insertions(+), 13 deletions(-) diff --git a/backend/app/api/agent.py b/backend/app/api/agent.py index 9081a8e..ab40e43 100644 --- a/backend/app/api/agent.py +++ b/backend/app/api/agent.py @@ -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 diff --git a/backend/app/api/board_group_memory.py b/backend/app/api/board_group_memory.py index 330f38a..82abf44 100644 --- a/backend/app/api/board_group_memory.py +++ b/backend/app/api/board_group_memory.py @@ -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 diff --git a/backend/app/api/boards.py b/backend/app/api/boards.py index d24e721..4c33ddf 100644 --- a/backend/app/api/boards.py +++ b/backend/app/api/boards.py @@ -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 diff --git a/backend/app/services/board_lifecycle.py b/backend/app/services/board_lifecycle.py index 879c0b2..f70a484 100644 --- a/backend/app/services/board_lifecycle.py +++ b/backend/app/services/board_lifecycle.py @@ -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 diff --git a/backend/app/services/openclaw/provisioning.py b/backend/app/services/openclaw/provisioning.py index 2c9bc96..3e1b0bc 100644 --- a/backend/app/services/openclaw/provisioning.py +++ b/backend/app/services/openclaw/provisioning.py @@ -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 diff --git a/backend/tests/test_boards_delete.py b/backend/tests/test_boards_delete.py index 77b22ea..bd5809f 100644 --- a/backend/tests/test_boards_delete.py +++ b/backend/tests/test_boards_delete.py @@ -10,8 +10,8 @@ from uuid import uuid4 import pytest -from app.api import boards import app.services.board_lifecycle as board_lifecycle +from app.api import boards from app.models.boards import Board from app.services.openclaw.gateway_rpc import OpenClawGatewayError diff --git a/backend/tests/test_template_size_budget.py b/backend/tests/test_template_size_budget.py index 4259d0d..5f58bc4 100644 --- a/backend/tests/test_template_size_budget.py +++ b/backend/tests/test_template_size_budget.py @@ -18,6 +18,6 @@ def test_heartbeat_templates_fit_in_injected_context_limit() -> None: ) for name in targets: size = (TEMPLATES_DIR / name).stat().st_size - assert size <= HEARTBEAT_CONTEXT_LIMIT, ( - f"{name} is {size} chars (limit {HEARTBEAT_CONTEXT_LIMIT})" - ) + assert ( + size <= HEARTBEAT_CONTEXT_LIMIT + ), f"{name} is {size} chars (limit {HEARTBEAT_CONTEXT_LIMIT})" diff --git a/frontend/src/api/generated/model/boardRead.ts b/frontend/src/api/generated/model/boardRead.ts index 2bd5231..c77118c 100644 --- a/frontend/src/api/generated/model/boardRead.ts +++ b/frontend/src/api/generated/model/boardRead.ts @@ -24,6 +24,7 @@ export interface BoardRead { require_approval_for_done?: boolean; require_review_before_done?: boolean; block_status_changes_with_pending_approval?: boolean; + only_lead_can_change_status?: boolean; id: string; organization_id: string; created_at: string; diff --git a/frontend/src/api/generated/model/boardUpdate.ts b/frontend/src/api/generated/model/boardUpdate.ts index b70f8ba..837e747 100644 --- a/frontend/src/api/generated/model/boardUpdate.ts +++ b/frontend/src/api/generated/model/boardUpdate.ts @@ -24,4 +24,5 @@ export interface BoardUpdate { require_approval_for_done?: boolean | null; require_review_before_done?: boolean | null; block_status_changes_with_pending_approval?: boolean | null; + only_lead_can_change_status?: boolean | null; }