The model association priority field in the AxonHub Admin UI is capped at 10, but the backend schema and documentation allow values up to 100. This creates an inconsistency where higher priority values can be set via API but not via the UI.
Steps to Reproduce
- Navigate to Models in Admin UI
- Open a model's Association dialog
- Try to set a rule's priority to any value above 10
Expected: UI and backend/schema use the same max priority value
Actual: UI caps at 10 while backend/schema cap at 100, creating an inconsistency
Root Cause
In frontend/src/features/models/components/models-association-dialog.tsx, the priority field is capped at 10 in three locations:
- Zod form schema -
.max(10)
- HTML input attribute -
max={10}
- onChange handler -
Math.max(0, Math.min(10, ...))
Additionally, handleAddAssociation() auto-assigns priority to newly added rules using Math.min(lastPriority + 1, 10), preventing the auto-increment from exceeding 10.
Origin
PR #344 (Dec 24, 2025) - "fix: model association priority and ui align" - introduced both .max(10) in the dialog AND .max(100) in schema.ts in the same PR, creating the inconsistency from the start.
Prior to PR #344, priority had no max constraint (z.number().optional().default(0) from PR #330).
Documentation vs UI Contradiction
The Model Management Guide explicitly recommends:
Priority Settings - Primary channels: 0-10, backup channels: 10-100
The documentation clearly intends for priority values above 10 to be used for backup and emergency tiers.
Proposed Fix
Files to modify
frontend/src/features/models/components/models-association-dialog.tsx
| Location |
Current |
Change |
| Form schema Zod |
.max(10) |
.max(100) |
HTML input max attr |
max={10} |
max={100} |
| onChange clamp |
Math.min(10, ...) |
Math.min(100, ...) |
| handleAddAssociation |
Math.min(lastPriority + 1, 10) |
lastPriority + 1 (no cap) |
Additional improvements
- Extract max priority to a constant (e.g.,
MAX_ASSOCIATION_PRIORITY = 100) for maintainability
- Update i18n error message: "Priority cannot exceed 10" → "Priority cannot exceed 100"
- Consider adding a tooltip/hint in the priority input explaining the recommended tiers (0-10 primary, 10-100 backup)
Only trying AxonHub for first time today. Reporting quirks as I find them.
The model association priority field in the AxonHub Admin UI is capped at 10, but the backend schema and documentation allow values up to 100. This creates an inconsistency where higher priority values can be set via API but not via the UI.
Steps to Reproduce
Expected: UI and backend/schema use the same max priority value
Actual: UI caps at 10 while backend/schema cap at 100, creating an inconsistency
Root Cause
In
frontend/src/features/models/components/models-association-dialog.tsx, the priority field is capped at 10 in three locations:.max(10)max={10}Math.max(0, Math.min(10, ...))Additionally,
handleAddAssociation()auto-assigns priority to newly added rules usingMath.min(lastPriority + 1, 10), preventing the auto-increment from exceeding 10.Origin
PR #344 (Dec 24, 2025) - "fix: model association priority and ui align" - introduced both
.max(10)in the dialog AND.max(100)inschema.tsin the same PR, creating the inconsistency from the start.Prior to PR #344, priority had no max constraint (
z.number().optional().default(0)from PR #330).Documentation vs UI Contradiction
The Model Management Guide explicitly recommends:
The documentation clearly intends for priority values above 10 to be used for backup and emergency tiers.
Proposed Fix
Files to modify
frontend/src/features/models/components/models-association-dialog.tsx.max(10).max(100)maxattrmax={10}max={100}Math.min(10, ...)Math.min(100, ...)Math.min(lastPriority + 1, 10)lastPriority + 1(no cap)Additional improvements
MAX_ASSOCIATION_PRIORITY = 100) for maintainabilityOnly trying AxonHub for first time today. Reporting quirks as I find them.