anishshiva7 opened a new pull request, #9667:
URL: https://github.com/apache/texera/pull/9667
### What changes were proposed in this PR?
The agent settings schemas on `POST /api/agents` and `PATCH
/api/agents/:id/settings` now bound the fields that had no bound:
| Field | Before | After |
| --- | --- | --- |
| `maxOperatorResultCharLimit` | `t.Number()` | `t.Integer({ minimum: 1 })` |
| `maxOperatorResultCellCharLimit` | `t.Number()` | `t.Integer({ minimum: 1
})` |
| `toolTimeoutSeconds` | `t.Number()` | `t.Number({ exclusiveMinimum: 0 })` |
| `executionTimeoutMinutes` | `t.Number()` | `t.Number({ exclusiveMinimum: 0
})` |
The bounds are deliberately loose: they reject only values that cannot be a
setting (zero, negative, or a fractional character count, which the execution
request's `Int` fields can't carry). No upper limit is added, and the UI's
tighter ranges are unchanged. Rejecting `0` also removes the create/update
inconsistency: create dropped `0`, while update stored it.
### Any related issues, documentation, discussions?
Closes #9666.
### How was this PR tested?
New `agent settings bounds` block in `server.spec.ts`:
| Test | Direction |
| --- | --- |
| PATCH rejects each invalid value (0, negative, fractional; 10 cases), and
a follow-up GET shows the old value | negative |
| POST rejects the same 10 values as initial settings | negative |
| PATCH accepts the smallest valid values (1, 0.5 min, 1, 1) | positive |
Before the fix 20 of these failed; all pass now.
```
cd agent-service
bun test # 368 pass, 0 fail
bunx tsc --noEmit
bunx prettier --check "src/**/*.{ts,tsx,json}"
```
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 5.5)
--
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]