Skip to content
TheChatArchiveThe Chat Archive
MiniMaxminimax/minimax-m3· 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. MiniMax Assistant

    Let me start by exploring the repository structure to understand the codebase.

  3. MiniMax Assistant

    Let me look at the relevantfile and structure.

  4. MiniMax Assistant

    Let me find the route that uses this schema.

  5. MiniMax Assistant

    Let me look at the tests for this area.

  6. MiniMax Assistant

    Let me look at the OpenAPI spec to understand the evaltable schema better.

  7. MiniMax Assistant

    Let me also check existing related tests:

  8. MiniMax Assistant

    Now let me check what existing UI usage exists for page size related settings:

  9. MiniMax Assistant

    Now let me look at the existing api/eval.ts file structure more carefully:

  10. MiniMax Assistant

    Now let me look at what happens in the route when validation fails:

  11. MiniMax Assistant

    Let me check how the schema is imported and used:

  12. MiniMax Assistant

    Let me also look at how superRefine is used in the codebase to make sure I follow the right pattern:

  13. MiniMax Assistant

    Let me first write a reproduction script to confirm the current behavior.

  14. MiniMax Assistant

    Now let me make the changes. First, I'll modify src/types/api/eval.ts to add the constant and update the schema:

  15. MiniMax Assistant

    Now let me make the changes:

  16. MiniMax Assistant

    Let me check the current contents:

  17. MiniMax Assistant

    Let me use replace to make the changes:

  18. MiniMax Assistant

    Let me write the new content to a separate file to avoid escape issues:

  19. MiniMax Assistant

    Let me verify the change:

  20. MiniMax Assistant

    Now let me verify the changes work:

  21. MiniMax Assistant

    All cases are working correctly:

    • Without format: limit > 1000 is rejected
    • With format (csv/json): any limit is accepted (including MAX_SAFE_INTEGER)
    • Boundary case: limit = 1000 is accepted
    • Default limit of 50 still works

    Now let me verify the route still works correctly. Let me check the route handler:

  22. MiniMax Assistant

    Let me also use the constant in the route for consistency:

  23. MiniMax Assistant

    Now let me check how superRefine errors look when used with prettifyError:

  24. MiniMax Assistant

    The error message is well-formatted. Now let me check the existing tests to see if they still pass:

  25. MiniMax Assistant

    All existing tests pass. Now let me also look at the redteam test for the schema:

  26. MiniMax Assistant

    Now let me run the existing tests:

  27. MiniMax Assistant

    The test failure looks unrelated to my changes - it's a database initialization issue. Let me verify by reverting and running the same test:

  28. MiniMax Assistant

    Good - the failure is pre-existing. Let me restore my changes:

  29. MiniMax Assistant

    Let me check whether the constant is actually used in the route, and if not, revert the import:

  30. MiniMax Assistant

    Let me revert the unused import from the route:

  31. MiniMax Assistant

    Let me clean up the extra blank line:

  32. MiniMax Assistant

    Looks like new is a reserved word in JS. Let me rename:

  33. MiniMax Assistant

    Now let me run the existing tests again to make sure everything still works:

  34. MiniMax Assistant

    Now let me also test with a more end-to-end test to validate route behavior:

  35. MiniMax Assistant

    All the tests pass. Now let me also test the route directly to ensure the validation properly returns 400:

  36. MiniMax Assistant

    Let me try a different approach to test the route:

  37. MiniMax Assistant

    The test infrastructure seems to be having issues with beforeAll. Let me check the existing test file structure:

  38. MiniMax Assistant

    Let me check the existing test file imports:

  39. MiniMax Assistant

    All 4 tests pass:

    1. Returns 400 when non-export limit exceeds max ✓
    2. Accepts limit at the boundary (1000) for non-export requests ✓
    3. Accepts large limits when format=csv is set ✓
    4. Accepts Number.MAX_SAFE_INTEGER when format=csv is set ✓

    Let me clean up the temporary test file:

  40. MiniMax Assistant

    Let me run the existing eval.export.test.ts to make sure it still passes:

  41. MiniMax Assistant

    All 13 export tests pass. Let me also check the other related test files:

  42. MiniMax Assistant

    All tests pass. Let me also look at the structure of the file once more to confirm everything looks good:

  43. MiniMax Assistant

    Let me also verify TypeScript compilation:

  44. MiniMax Assistant

    There's a TypeScript error. Let me check the Zod version:

  45. MiniMax Assistant

    Let me fix the schema to use the correct property name:

  46. MiniMax Assistant

    Now let me run the TypeScript check again:

  47. MiniMax Assistant

    TypeScript compiles cleanly. Now let me verify the tests still pass:

  48. MiniMax Assistant

    All 76 tests pass. Let me also verify the schema still works as expected:

  49. MiniMax Assistant

    Excellent! Everything works correctly. Let me also make sure the diff is clean and minimal:

  50. MiniMax Assistant

    Let me run the linter to make sure the code is clean:

  51. MiniMax Assistant

    No linting errors. Let me also run a broader test to make sure I haven't broken anything else:

  52. MiniMax Assistant

    The test failures are all due to the same pre-existing database initialization issue (Cannot read properties of undefined (reading 'listening')), not related to my changes. Let me verify by checking what tests pass andfail:

  53. MiniMax Assistant

    Let me verify these failures are pre-existing by reverting my changes temporarily:

  54. MiniMax Assistant

    Confirmed - these 4 test failures are pre-existing and not related to my changes. Let me restore my changes:

  55. MiniMax Assistant

    Let me run all the related tests one more time to make sure everything works:

  56. MiniMax Assistant

    All 76 tests pass. Let me also run a final view of the changes:

  57. MiniMax Assistant

    Let me also verify the linting once more:

  58. MiniMax Assistant

    Now let me also run the broader types test to make sure no types are broken:

  59. MiniMax Assistant

    All 410 type tests pass. Let me do a final summary review of the changes:

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