[fix] resolve 16 mypy errors across 9 test files (make quality gate)

type-clean the test files so make quality (mypy roboco/ tests/) is green:
- Any-typed locals for the two TypeError-asserting scoping tests (bypass
  the required-arg check without getattr/ruff B009)
- Any-typed view for the shutdown-drain _drain_bg_tasks override (bypass
  mypy method-assign without setattr/ruff B010)
- cast("uuid.UUID", ...) / cast("UUID", ...) for SQLAlchemy UUID[Any]
  returns (TC006-quoted), config=None for AgentInstance stubs, None-narrowed
  await_args, Iterator return on a yielding fixture, UUID annotation on the
  _task helper. No type:ignore / noqa.
This commit is contained in:
Renn F
2026-06-29 02:33:09 +02:00
parent 041d0694d3
commit 592c84da5d
9 changed files with 44 additions and 20 deletions
@@ -61,7 +61,9 @@ def _wire(monitor: dict[str, Any]) -> Any:
# Mirrors the real prepare's registration side-effect so the RED test
# observes the STARTING instance the current code leaks.
cfg = SimpleNamespace(provider_type="anthropic", model="opus")
inst = AgentInstance(agent_id="be-dev-1", state=AgentState.STARTING, config=cfg)
inst = AgentInstance(
agent_id="be-dev-1", state=AgentState.STARTING, config=None
)
return cfg, inst, None
return _readiness_gate, _git_context, _route, _prepare
@@ -116,7 +118,7 @@ async def test_not_parked_spawn_still_runs_prepare_and_launches(
return AgentInstance(
agent_id="be-dev-1",
state=AgentState.ACTIVE,
config=SimpleNamespace(provider_type="anthropic", model="opus"),
config=None,
)
monkeypatch.setattr(orch, "_readiness_gate", _rg)
@@ -146,7 +148,7 @@ async def test_running_agent_not_bailed_by_parked_check(
existing = AgentInstance(
agent_id="be-dev-1",
state=AgentState.ACTIVE,
config=SimpleNamespace(provider_type="anthropic", model="opus"),
config=None,
)
orch._instances["be-dev-1"] = existing