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 explore the relevant directory and find the eval table route.

  4. MiniMax Assistant

    Now let me look at the types/api/eval.ts file to understand the schema:

  5. MiniMax Assistant

    Now let me look at the existing tests for the eval table route:

  6. MiniMax Assistant

    Let me check similar list-style APIs to see the pattern used for cap page sizes:

  7. MiniMax Assistant

    Let me check if there are tests for the schema validation:

  8. MiniMax Assistant

    Now let me check the entire test/types/apiSchemas.redteam.test.ts file to understand the test structure:

  9. MiniMax Assistant

    Now let me look at the frontend code that uses the limit:

  10. MiniMax Assistant

    Let me look at the export route tests more carefully:

  11. MiniMax Assistant

    Let me look at the route validation logic in detail:

  12. MiniMax Assistant

    Now let me check the current state of src/server/routes/eval.ts to understand the full route flow:

  13. MiniMax Assistant

    Let me also see how params and query are validated to understand the structure:

  14. MiniMax Assistant

    Let me see if there are any other places that use thisendpoint:

  15. MiniMax Assistant

    Let me look at all the tests that use limit with format:

  16. MiniMax Assistant

    Let me look at how other schemas in the codebase handle conditional validation:

  17. MiniMax Assistant

    Now let me check if there are other places that use the limit/eval table schema:

  18. MiniMax Assistant

    Let me also check the existing structure of the eval.ts file in src/types/api/:

  19. MiniMax Assistant

    Now I have a good understanding of the codebase. Let me write a quick reproduction script to confirm the issue:

  20. MiniMax Assistant

    Now I have confirmed the issue. Let me implement the fix:

  21. MiniMax Assistant

    Now I'll make the changes to add the constant and the conditional validation:

  22. MiniMax Assistant

    Let me make the change to the eval.ts file. I'll add the constant and modify the schema to apply the cap only when format is not set.

  23. MiniMax Assistant

    Now let me run the reproduction script to confirm the fix works:

  24. MiniMax Assistant

    All tests pass as expected. Now let me run the existing tests to make sure nothing is broken:

  25. MiniMax Assistant

    This is a pre-existing issue with the better-sqlite3 native bindings - not related to my change. Let me verify this:

  26. MiniMax Assistant

    Confirmed - this is a pre-existing issue. Let me restore my changes:

  27. MiniMax Assistant

    Now let me run all the related tests to make sure everything still works:

  28. MiniMax Assistant

    Let me try to rebuild better-sqlite3 to make these tests pass:

  29. MiniMax Assistant

    All 107 tests pass! Let me also run a broader set of tests:

  30. MiniMax Assistant

    All 906 tests pass. Let me also verify the change in OpenAPI generation still works:

  31. MiniMax Assistant

    Let me clean up the temp file I created:

  32. MiniMax Assistant

    Now let me also check the diff to make sure my changes are clean:

  33. MiniMax Assistant

    Let me check the error message convention used by Zod's built-in .max() validator to ensure consistency:

  34. MiniMax Assistant

    Let me update the error message to match Zod's standard format for consistency:

  35. MiniMax Assistant

    Let me verify the change by running my reproduction script again:

  36. MiniMax Assistant

    Now let me re-run all the tests to ensure nothing is broken:

  37. MiniMax Assistant

    All 906 tests pass. Let me clean up:

  38. MiniMax Assistant

    Let me do a final review of the changes:

  39. MiniMax Assistant

    Let me do a final verification by running all the related tests:

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