Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/src/agent_control_server/endpoints/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ async def list_agents(
# Fetch limit + 1 to check if there are more pages
query = query.limit(limit + 1)
result = await db.execute(query)
agents = result.scalars().all()
agents: Sequence[Agent] = result.scalars().all()

# Check if there are more pages
has_more = len(agents) > limit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def _apply_filters(stmt): # type: ignore[no-untyped-def]
if cursor is not None:
page_stmt = page_stmt.where(ControlBinding.id < cursor)
result = await self._db.execute(page_stmt.limit(limit + 1))
rows = list(result.scalars().all())
rows: list[ControlBinding] = list(result.scalars().all())
has_more = len(rows) > limit
if has_more:
rows = rows[:limit]
Expand Down
4 changes: 2 additions & 2 deletions server/src/agent_control_server/services/controls.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ async def list_versions(
stmt = stmt.where(ControlVersion.version_num < cursor)

result = await self._db.execute(stmt.limit(limit + 1))
versions = list(result.scalars().all())
versions: list[ControlVersion] = list(result.scalars().all())

has_more = len(versions) > limit
if has_more:
Expand Down Expand Up @@ -509,7 +509,7 @@ async def list_controls_page(
query = query.where(Control.id < cursor)

result = await self._db.execute(query.limit(limit + 1))
controls = list(result.scalars().all())
controls: list[Control] = list(result.scalars().all())

total_query = (
select(func.count())
Expand Down
Loading