Skip to content
TheChatArchiveThe Chat Archive
xiaomi/mimo-v2.5-pro· unknownHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION Cap eval table page size for non-export requests Summary GET…

  1. User

    ISSUE DESCRIPTION

    Cap eval table page size for non-export requests

    Summary

    GET /api/eval/:id/table accepts any positive integer for limit on normal table requests. The route already intentionally treats export requests differently by using Number.MAX_SAFE_INTEGER when format is set, but non-export page requests currently do not have an upper bound.

    Why this matters

    A very large limit can make a normal table request ask the server to load and serialize a large amount of eval result data in one response. Other list-style APIs in the server already bound their page sizes, so the eval table endpoint should follow the same resource-control pattern.

    Proposed change

    • Add a maximum limit for non-export GET /api/eval/:id/table requests.
    • Keep format=csv / format=json exports unchanged so full-table exports still work as intended.
    • Return validation errors for excessive non-export limits, consistent with nearby API schema validation.

    A cap of 500 or 1000 would likely cover normal UI usage while preventing accidental oversized page requests.

    Validation

    Suggested tests:

    • schema test rejects EvalSchemas.Table.Query.safeParse({ limit: '<cap + 1>' })
    • route validation test returns 400 for excessive non-export limit
    • export route tests continue to use Number.MAX_SAFE_INTEGER when format is present

    Interface

    Type: Constant Name: EVAL_TABLE_MAX_PAGE_SIZE Path: src/types/api/eval.ts Value/Type: constant literal value 1000 (number) Description: Server-enforced upper bound for the limit parameter on non-export eval table page requests. Exports using format (csv/json) are exempt from this cap; UI pagination controls derive their available page-size options from this value.

    ADDITIONAL ADVICE

    Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use git checkout <file> to restore the file to its original state. You can also reset all changes in the repository using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.

    CHECKLIST

    Before submitting your solution, please go over the following checklist and make sure you've done everything:

    • If an error was reported in the issue description, I have successfully reproduced it.
    • If an error was reported in the issue description, I have confirmed that my fix resolves the error.
    • I have thought about edge cases and made sure my fix handles them as well.
    • I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.

    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!

    (Current directory: /promptfoo, current file: none) bash-$

  2. Assistant

    I'll start by exploring the repository structure to understand the codebase. Let me first check the current directory and see what's there.

  3. Assistant

    Let me look at the eval-related API files mentioned in the issue.

  4. Assistant

    Let me look at the key files: src/types/api/eval.ts and the route handler for the eval table endpoint.

  5. Assistant

    Now let me look at the route handler for the eval table endpoint:

  6. Assistant

    Let me check the eval route handler.

  7. Assistant

    Let me search for the table endpoint handler in the eval routes:

  8. Assistant

    Let me look at the table endpoint more closely.

  9. Assistant

    Let me check the UNLIMITED_RESULTS constant and the test file:

  10. Assistant

    Now let me look at the existing test file:

  11. Assistant

    Let me also check how other APIs bound their page sizes for reference:

  12. Assistant

    Let me also check the blobs schema to see the max pattern:

  13. Assistant

    Now let me check if there are frontend pagination controls that reference this limit:

  14. Assistant

    Let me look at the SettingsPanel to understand how the page size is currently configured.

  15. Assistant

    Now let me look at where the page size is used in the frontend eval table:

  16. Assistant

    Let me look more carefully at the table route for any variable naming issues:

  17. Assistant

    Now I have a clear understanding of the codebase. Let me now look at how the schema is structured and plan my approach:

    1. Add EVAL_TABLE_MAX_PAGE_SIZE constant in src/types/api/eval.ts
    2. Modify EvalTableQuerySchema to enforce the max limit only when format is not present (using .superRefine())
    3. No changes needed in the route handler since it already handles export separately

    Let me first verify the test suite runs:

  18. Assistant

    Let me check if there are route-level tests for the eval table:

  19. Assistant

    Let me check the validation tests:

  20. Assistant

    Now let me check the export tests:

  21. Assistant

    Let me also check for frontend code that might reference page sizes for pagination:

  22. Assistant

    Let me check the ResultsTable to see what page size options are available:

  23. Assistant

    Let me see what page size options are available in the dropdown:

  24. Assistant

    Now I have a clear picture. Let me implement the changes:

    1. Add EVAL_TABLE_MAX_PAGE_SIZE constant in src/types/api/eval.ts
    2. Modify EvalTableQuerySchema to validate limit against the cap when format is not present
    3. Keep exports unchanged

    Let me start by editing the schema file:

  25. Assistant

    Now let me add the constant and modify the schema:

  26. Assistant

    Let me use line ranges for the edit:

  27. Assistant

    I need to edit lines 83-100 to add the constant and modify the schema. Let me use the edit command with line range.

  28. Assistant

    Let me use the edit command with line range:

  29. Assistant

    Let me use the correct syntax for the edit command:

  30. Assistant

    Let me try with node or python instead.

  31. Assistant

    Let me use node to apply the patch.

  32. Assistant

    Now let me verify the change was applied correctly:

  33. Assistant

    Good, the change is applied. Now let me create a quick test to verify the schema behavior:

  34. Assistant

    Let me run the existing tests to make sure things still work:

  35. Assistant

    Let me also run the validation route tests:

  36. Assistant

    Let me run the export tests too:

  37. Assistant

    Let me run the other eval-related tests:

  38. Assistant

    The filtered metrics test fails due to database issues (native binary missing) - that's not related to my changes. Let me verify which test file passed:

  39. Assistant

    Now let me check if the route handler needs to be updated to import the new constant. Let me look at what it currently imports:

  40. Assistant

    Let me check how UNLIMITED_RESULTS is used and verify the route still works correctly:

  41. Assistant

    Let me run the server API schemas test:

  42. Assistant

    All tests pass. Now let me write a quick verification script to test the schema behavior:

  43. Assistant

    Let me fix the path:

  44. Assistant

    All tests pass. Let me clean up the verification test file:

  45. Assistant

    Now let me check if the frontend code needs any updates for consistency. Let me see if it imports from the types file:

  46. Assistant

    Let me check if there are any CLI commands that might need to know about this limit:

  47. Assistant

    Good. Now let me run all the eval-related tests to make sure everything passes:

  48. Assistant

    All 72 tests pass across all 5 test files. Let me also make sure the TypeScript compilation works:

  49. Assistant

    There's a TypeScript error. The too_big issue requires an origin field in the newer version of Zod. Let me check the version and fix:

  50. Assistant

    Zod v4 has a different API for too_big issues. Let me check what the correct properties are.

  51. Assistant

    I need to add origin: 'int' to the issue. Let me also check what z.ZodIssueCode looks like in v4:

  52. Assistant

    Good. I need to add origin: 'int' to the ctx.addIssue() call. Let me fix the schema:

  53. Assistant

    Let me use node to patch the file:

  54. Assistant

    Let me verify the TypeScript compilation now:

  55. Assistant

    TypeScript compilation passes. Let me run the tests again to make sure everything still works:

  56. Assistant

    All 72 tests pass. Let me run the verification script again to make sure the behavior is correct:

  57. Assistant

    All verification tests pass. Let me clean up the test file:

  58. Assistant

    Let me now verify the final state of the changes I've made:

  59. Assistant

    The changes look clean and correct. Let me do a final comprehensive test run:

  60. Assistant

    All 72 tests pass across all 5 test files. Let me also verify the TypeScript compilation one final time:

  61. Assistant

    Let me verify the final state of the file one more time:

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.