roshiiiz commented on PR #7821:
URL: https://github.com/apache/texera/pull/7821#issuecomment-5394757774
> Thansk for the PR, nice catch! Though there's one edge still open:
stepCountIs stops on strict equality (steps.length === maxSteps), so a
non-integer like maxSteps: 2.5 never stops the loop either. Same runaway as 0,
and it slips past both minimum: 1 and the Math.max. Suggest tightening to:
>
> `maxSteps: t.Optional(t.Integer({ minimum: 1 }))`
>
> and Math.max(1, Math.trunc(updates.maxSteps)) in the clamp. Worth adding
2.5 to the new test as well.
Good catch.
I've just pushed a commit implementing exactly what you suggested:
Tightened the Elysia schema to use t.Integer({ minimum: 1 }).
Added the Math.trunc wrapper to the internal fallback clamp in
texera-agent.ts.
Added the 2.5 test case to texera-agent.spec.ts to lock it in.
Thanks for the review, Let me know if everything looks good to go.
<img width="1128" height="259" alt="image"
src="https://github.com/user-attachments/assets/aa6c30ef-b793-4236-83dc-0ebbc424e8eb"
/>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]