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.