You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Governance feature-control "Max context tokens" below 4096 saves as a silent false-success (optimistic row, dialog closes, nothing persists, raw ConvexError in console) #2660
The Feature-controls rule editor (Governance → Policies & Limits) lets you enter a Max context tokens value below the server's 4096 floor. The client Input has no lower bound, so on Confirm the dialog closes, the rule row optimistically appears with the entered value — but the server rejects it with an uncaught ConvexError (validation), nothing persists, and on reload the rule is gone. The user believes they set a token cap; they didn't, and the only signal was a console error.
Dialog closes; the rule row shows "default / All users / ✔✔✔ / 1,000" as if saved. Console logs:
[CONVEX A(governance/file_actions:saveGovernancePolicy)] Uncaught ConvexError:
{"code":"validation","message":"Invalid feature_flags configuration: [ … maxContextTokens … "Too small: expected number to be >=4096" ]"}
at handler (../../convex/governance/file_actions.ts:175:8)
Reload → "No feature control rules configured." The rule never persisted; no user-visible error at any point.
Code pointers
app/features/settings/governance/components/feature-flags-editor.tsx — Max-context-tokens Input has min={0} (no 4096 floor); handleSubmit has no client validation; save-error path surfaces error.message raw
convex/governance/file_actions.ts:175 — saveGovernancePolicy throws the validation ConvexError
Proposed change
Enforce the 4096 floor client-side inline (like budget-editor's validateBudgetRule), keep Confirm disabled with a field error until valid, and don't optimistically render an unsaved rule. Route the save error through mapGovernanceSaveError so a rejection is visible and localized.
Acceptance criteria
A sub-4096 value is blocked inline with a localized field error; Confirm stays disabled
No optimistic row appears for a rejected save; no uncaught ConvexError
Activity