Bug Description
When creating a cron job with a custom model parameter using an object format ({"model": "...", "provider": "..."}), the command fails with a TypeError.
ERROR MESSAGE:
TypeError: '<=' not supported between instances of 'str' and 'int'
This occurs when using the --model flag with a JSON object string during cron job creation. The cronjob update command handles the same model parameter correctly, which suggests inconsistent parameter handling between the create() and update() functions in the cronjob module.
The error happens during the validation logic in the create() function, where a string is being compared to an integer using <= operator.
Steps to Reproduce
-
Open terminal and run the following command:
cronjob create --prompt "test task" --schedule "0 9 * * *" --deliver telegram --model '{"model":"gemma4:31b","provider":"custom"}'
-
Observe the error output:
TypeError: '<=' not supported between instances of 'str' and 'int'
-
The cron job is not created - command exits with error.
-
Try the workaround - create without model, then update:
cronjob create --prompt "test task" --schedule "0 9 * * *" --deliver telegram
cronjob update --job_id --model '{"model":"gemma4:31b","provider":"custom"}'
This works correctly, confirming the bug is in create() only.
Expected Behavior
The cronjob create command should accept the --model parameter with a JSON object string, exactly like the cronjob update command does.
Expected behavior:
- Command should parse the model parameter correctly
- Cron job should be created with the specified model configuration
- No TypeError should occur
- The created job should use the specified model (gemma4:31b from custom provider)
The create() and update() functions should have consistent parameter handling.
Actual Behavior
Command fails immediately with TypeError:
TypeError: '<=' not supported between instances of 'str' and 'int'
The cron job is NOT created. The command exits with an error code.
CURRENT WORKAROUND:
-
Create the cron job WITHOUT the model parameter:
cronjob create --prompt "test task" --schedule "0 9 * * *" --deliver telegram
-
Update the job to add the model parameter:
cronjob update --job_id --model '{"model":"gemma4:31b","provider":"custom"}'
This two-step process works correctly, which proves the model parsing logic exists and works in update() but is broken in create().
Affected Component
CLI (interactive chat)
Messaging Platform (if gateway-related)
No response
Operating System
macOS 15.2 (Apple Silicon)
Python Version
3.11 (Homebrew)
Hermes Version
v0.8+ (development branch)
Relevant Logs / Traceback
Root Cause Analysis (optional)
The bug appears to be in the cronjob create() function's parameter validation logic.
SUSPECTED LOCATION:
- File: Likely in cli.py or cronjob.py
- Function: create()
- Issue: Type comparison bug where a string value is compared to an integer using <= operator
The update() function handles the same model object correctly, which suggests:
- The model parameter parsing code exists and works
- The create() function has different (broken) validation logic
- Both functions should use the same parsing/validation code path
RECOMMENDED FIX:
Unify the model parameter parsing and validation between create() and update() functions. Review the type checking logic for model configuration objects in the create() function.
Proposed Fix (optional)
No response
Are you willing to submit a PR for this?
Bug Description
When creating a cron job with a custom model parameter using an object format ({"model": "...", "provider": "..."}), the command fails with a TypeError.
ERROR MESSAGE:
TypeError: '<=' not supported between instances of 'str' and 'int'
This occurs when using the --model flag with a JSON object string during cron job creation. The cronjob update command handles the same model parameter correctly, which suggests inconsistent parameter handling between the create() and update() functions in the cronjob module.
The error happens during the validation logic in the create() function, where a string is being compared to an integer using <= operator.
Steps to Reproduce
Open terminal and run the following command:
cronjob create --prompt "test task" --schedule "0 9 * * *" --deliver telegram --model '{"model":"gemma4:31b","provider":"custom"}'
Observe the error output:
TypeError: '<=' not supported between instances of 'str' and 'int'
The cron job is not created - command exits with error.
Try the workaround - create without model, then update:
cronjob create --prompt "test task" --schedule "0 9 * * *" --deliver telegram
cronjob update --job_id --model '{"model":"gemma4:31b","provider":"custom"}'
This works correctly, confirming the bug is in create() only.
Expected Behavior
The cronjob create command should accept the --model parameter with a JSON object string, exactly like the cronjob update command does.
Expected behavior:
The create() and update() functions should have consistent parameter handling.
Actual Behavior
Command fails immediately with TypeError:
TypeError: '<=' not supported between instances of 'str' and 'int'
The cron job is NOT created. The command exits with an error code.
CURRENT WORKAROUND:
Create the cron job WITHOUT the model parameter:
cronjob create --prompt "test task" --schedule "0 9 * * *" --deliver telegram
Update the job to add the model parameter:
cronjob update --job_id --model '{"model":"gemma4:31b","provider":"custom"}'
This two-step process works correctly, which proves the model parsing logic exists and works in update() but is broken in create().
Affected Component
CLI (interactive chat)
Messaging Platform (if gateway-related)
No response
Operating System
macOS 15.2 (Apple Silicon)
Python Version
3.11 (Homebrew)
Hermes Version
v0.8+ (development branch)
Relevant Logs / Traceback
Root Cause Analysis (optional)
The bug appears to be in the cronjob create() function's parameter validation logic.
SUSPECTED LOCATION:
The update() function handles the same model object correctly, which suggests:
RECOMMENDED FIX:
Unify the model parameter parsing and validation between create() and update() functions. Review the type checking logic for model configuration objects in the create() function.
Proposed Fix (optional)
No response
Are you willing to submit a PR for this?