Invalid Validation Error on Auto Top-Up Configuration

๐งพ Description
When saving the Auto Top-Up configuration, the system shows an error message:
'daily_limits.max_attempts' must be an integer
even though the user correctly entered 0.5 ABT in the Daily Top-up Amount Limit and Daily Top-up Attempts Limit fields.
This indicates a type mismatch or validation logic bug โ the field visually accepts decimal values, but the backend expects an integer input.
๐ Steps to Reproduce
- Go to https://hub.aigne.io/ai-kit/credit-usage.
- Enable Auto Top-Up.
- Set:
- When credits are below:
0.01 - Top-up Amount per Time:
0.5 ABT - Daily Top-up Amount Limit:
0.5 ABT - Daily Top-up Attempts Limit:
0.5
- Click Save Configuration.
- Observe the red error message: >
'daily_limits.max_attempts' must be an integer>
โ Expected Behavior
- The system should allow decimal values (like 0.5) in the โDaily Top-up Attempts Limitโ and โDaily Top-up Amount Limitโ fields, or clearly restrict input to integers if decimals are not supported.
- Validation should match the frontend input format (ABT token amounts can be fractional).
โ Actual Behavior
- The input is valid and formatted correctly.
- The backend validation incorrectly rejects it with a misleading error message.
๐งฐ Environment
- Platform: AIGNE Hub
- Device: Desktop
- Browser: Chrome (Latest)
- OS: Windows 11
- Reproducibility: 100%
๐ Impact
- Severity: Medium
- Priority: High
- Impact:
- Users cannot save a valid Auto Top-Up configuration.
- May block automatic credit replenishment, leading to failed model usage.
๐ง Suggested Fix
- Align frontend and backend validation rules โ allow fractional ABT values for top-up fields.
- If integer is required, restrict input field and update the placeholder to guide the user.
- Update error message to specify which field failed validation and why.
2 ๆกๅๅค
This is the daily top-up limit for the number of automatic recharges. The number of times has no concept of decimals and can only be limited to integers.
I would like a 1.25 top-up, for it is my lucky number.