Repository navigation
Read the custom instructions limit from an environment variable - #73
maxime-pharmania wants to merge 3 commits into
Conversation
…LENGTH The limit was a build-time constant, so every deployment that needed a longer custom prompt had to patch the source. It now resolves at runtime from PROVAL_USER_PROMPT_MAX_LENGTH: the API enforces the resolved value, announces it on /api/auth/me, and the repository form uses the announced limit instead of the bundled one. A value that is not a positive integer is ignored and the default applies.
|
Hi @seoes — this PR makes the custom-instructions limit configurable via OverviewSummaryThe hard-coded Good points
Additional Notes
|
|
|
Hi @seoes — this follow-up cleanly closes out every gap raised in the previous review: env-safe test cleanup, OverviewSummaryThe push replaces blind Good points
Main IssuesNone — no critical or problem-level findings in this push. Additional Notes
|
Every userPrompt test asserted a rejection, so a > to >= regression on the effective limit would have rejected a prompt of exactly the allowed length without failing any test. The new case accepts a prompt at the default limit and at a limit set by PROVAL_USER_PROMPT_MAX_LENGTH; it fails when the comparison is changed to >=.
|
Right, and worth pinning: fixed in A new case accepts a prompt of exactly |
|
Hi @seoes — this follow-up adds the accept-path boundary test that was the only open note from the previous review, and it closes it cleanly. SummaryA single new test in Good points
Main IssuesNone — no critical or problem-level findings in this push. Additional Notes
|
Brings in the review fixes of seoes#71 (choices guard on the buffered path, single call site for the custom instructions limit) and of seoes#73 (typed layout props, .env.example entry, environment cleanup in the repository tests, getMe announcement test, inclusive boundary test). The fork keeps 9000 as its default limit.
|
Hi @maxime-pharmania, thanks for the PR. Yeah I set a limit for user prompt to 2000 and now that I look at it, it seems too short. I didn't mean to give users a short limit. It can be like 100,000 or more. (Hosting with own model and can't even set user prompt because of limit is crazy) I'm willing to change that 2000 limit. and to be honest, I’ve built Proval from the start around keeping things minimal and simple, and I’ve tried to stick to that in the code and structure. Your implementation is solid, but for “user prompt max length” alone it still feels like a lot of surface area. If you’re ok with it, I’d rather do a small change that only bumps BTW, Proval recently got support for reading each repo’s |
The custom instructions limit was the build-time constant
USER_PROMPT_MAX_LENGTH, so a deployment that needs a longer prompt has to patch the source.resolveUserPromptMaxLength()in@proval/typesreadsPROVAL_USER_PROMPT_MAX_LENGTH; a value that is not a positive integer is ignored and the constant applies.GET /api/auth/me(userPromptMaxLength).