From 83cce09b1a7cc7401028e5a161959c324b56bde7 Mon Sep 17 00:00:00 2001 From: giles Date: Sun, 11 Jan 2026 12:22:59 +0000 Subject: [PATCH] Fix list_runs to use offset parameter Match the router's expected signature and return type. Co-Authored-By: Claude Opus 4.5 --- app/services/run_service.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/app/services/run_service.py b/app/services/run_service.py index e98e7fb..0b25fb7 100644 --- a/app/services/run_service.py +++ b/app/services/run_service.py @@ -26,7 +26,7 @@ class RunService: return None return json.loads(data) - async def list_runs(self, actor_id: str, page: int = 1, limit: int = 20) -> Dict[str, Any]: + async def list_runs(self, actor_id: str, offset: int = 0, limit: int = 20) -> list: """List runs for a user with pagination.""" # Get all runs and filter by actor # TODO: Use Redis index for efficient filtering @@ -52,20 +52,7 @@ class RunService: all_runs.sort(key=lambda r: r.get("created_at", ""), reverse=True) # Paginate - total = len(all_runs) - start = (page - 1) * limit - end = start + limit - runs = all_runs[start:end] - - return { - "runs": runs, - "pagination": { - "page": page, - "limit": limit, - "total": total, - "has_more": end < total, - } - } + return all_runs[offset:offset + limit] async def create_run( self,