chiguyong
|
7b1b198058
|
refactor(orchestrator+bitable): remove Any from type signatures
Test / backend-test (pull_request) Has been cancelled
Details
Test / frontend-unit (pull_request) Has been cancelled
Details
Test / api-e2e (pull_request) Has been cancelled
Details
Test / frontend-e2e (pull_request) Has been cancelled
Details
Eliminate 112 Any usages across orchestrator/ (62) and bitable/ (50) via:
- TYPE_CHECKING Protocol for Redis/LLMGateway/Plan/Dispatcher/StateManager
- object for arbitrary dict/list/value types (Pydantic v2 serializes fine)
- RecalcTask concrete import (replacing Any in recalc_worker.py)
- Coroutine[object, object, object] for async generic
- Remove unused Any imports (F401 cleanup)
Note: Avoided recursive TypeAlias (FieldValue) because Pydantic v2 cannot
build schemas for recursive named aliases (RecursionError).
Tests: 245 passed (bitable 91 + orchestrator 154), 0 regressions
ruff: All checks passed
|
2026-07-01 02:41:14 +08:00 |
chiguyong
|
34a89c4873
|
refactor(llm+memory+client): remove Any from type signatures
Eliminate 172 Any usages across llm/, memory/, client/ via:
- TypeAlias (MetadataValue, MetadataDict, RAGSearchResult, etc.)
- object for arbitrary dict/value types
- TYPE_CHECKING Protocol for Redis/Quota/RAG/Graph services
- TYPE_CHECKING import + string annotations for forward refs
- Remove unused Any imports (18 F401 fixed)
Tests: 253 passed (llm 21 failures are pre-existing litellm env issue)
ruff: All checks passed
|
2026-07-01 02:03:51 +08:00 |
chiguyong
|
aa6367ff9f
|
refactor(server/routes): classify except Exception in 23 route files
Narrow 131 except Exception to specific exception types across all
server/routes/ modules. Framework boundaries (main execute paths,
WebSocket top-level) retain except Exception with asyncio.CancelledError
guard.
Categories:
- WebSocket ops: (ConnectionError, RuntimeError, asyncio.TimeoutError)
- DB/Store ops: (ConnectionError, OSError, asyncio.TimeoutError, ValueError, KeyError, RuntimeError)
- EventQueue: (asyncio.QueueFull, RuntimeError, ConnectionError)
- Config construction: (ValueError, TypeError, KeyError)
- Cleanup/dissolve: (RuntimeError, asyncio.TimeoutError, ConnectionError)
- HTTP handlers: business-specific exceptions
- Framework boundaries: retain except Exception + CancelledError guard
Stats: 101 narrowed, 31 framework boundary retained, 2 noqa (DB resilience)
Follow-up to PR #8 (U1-U5 systematic tech debt cleanup).
|
2026-07-01 01:26:31 +08:00 |