feat(engine-settings): add 'number' variant to engine setting fields#875
feat(engine-settings): add 'number' variant to engine setting fields#875
Conversation
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
LGTM — Clean implementation of numeric engine setting fields. The type additions are symmetric between backend and frontend, the FieldControl extraction is a good refactor, and the number parsing logic is correct.
Should Fix (non-blocking)
-
Stale TODO comments:
src/backends/catalog.ts(lines 70-71) andsrc/backends/claude-code/settings.ts(lines 8-10) still reference "Story #2" and state that numeric field rendering isn't implemented yet. Since this PR implements it, those comments should be cleaned up in a follow-up. -
No client-side min/max enforcement in onChange handler: The
<Input type="number">passesmin/max/stepas HTML attributes, but browsertype="number"inputs don't actually prevent out-of-range values from being typed — they only affect the stepper and:invalidpseudo-class. TheonChangehandler accepts any valid number regardless ofmin/max. This is mitigated by the Zod schema on the backend (z.number().int().positive()forthinkingBudgetTokens), so it's not a correctness bug, but adding client-side clamping/validation would improve UX by giving immediate feedback. Worth considering for a follow-up. -
Catalog doesn't use new
min/max/stepprops: ThethinkingBudgetTokensfield incatalog.tsdoesn't specifymin,max, orstep, even though the Zod schema requiresint().positive(). Addingmin: 1andstep: 1to the catalog entry would make the UI stepper and constraints match the backend validation — good for a follow-up.
Inline Notes
- web/src/components/settings/engine-settings-fields.tsx:106 — Nitpick:
Number(trimmed)accepts"Infinity"and"-Infinity"(these are not NaN), though HTMLtype="number"inputs prevent typing these in practice. If this component ever receives programmatic input, you may wantNumber.isFinite(parsed)instead of!Number.isNaN(parsed).
🕵️ claude-code · claude-opus-4-6 · run details
Summary
min,max, andstepoptional props to the'number'variant ofAgentEngineSettingFieldinsrc/backends/types.ts(the TODO comment about Story chore: add .nvmrc for Node.js 22 #2 is now resolved)EngineSettingFieldtype inengine-settings-fields.tsxto mirror the backend withmin/max/step<Input type="number">rendering for number fields inEngineSettingsFields, with inherit/default placeholder and value stored as a number (cleared toundefinedwhen empty)FieldControlhelper component to keep cognitive complexity within the linter limitCloses Trello card: https://trello.com/c/f7eciwO5/392-as-a-developer-i-want-numeric-engine-setting-fields-so-that-thinkingbudgettokens-can-be-configured-in-the-dashboard
Work item: https://trello.com/c/69b6cf2712b4af253a3e3dd1
Test plan
npm run lint— zero errors/warningsnpm run typecheck— zero errorsselectandbooleanfields render unchanged<Input type="number">with optionalmin/max/stepconstraintsundefined(inherit behaviour)number, not a string🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details