Problem
The scheduler backend (APScheduler + SQLite + EventBus) is fully functional, but there's no built-in user-facing interface to manage scheduled jobs. The current workaround is having Claude interact with the SQLite database directly via sqlite3 commands (possible since the bot runs on a VPS with CLI access), but this still requires a bot restart after every change and is a workaround rather than a proper solution.
Expected behavior
Users should be able to create, list, and manage scheduled jobs directly from the Telegram chat using a /schedule command.
Current architecture
The JobScheduler class already supports add_job(), remove_job(), and get_jobs(). It persists jobs to the scheduled_jobs SQLite table and loads them on startup. However, the instance is created locally in run_application() and is not injected into bot dependencies, making it inaccessible from command handlers.
Proposed solution
- Inject
JobScheduler into bot dependencies alongside ClaudeIntegration, SessionManager, etc.
- Add a
ScheduleCommandHandler registered for /schedule with subcommands:
/schedule list — show all active jobs
/schedule add <name> <cron> <prompt> — create a new job (auto-fills chat_id, working_directory, created_by from context)
/schedule remove <job_id> — soft-delete a job
/schedule pause <job_id> / /schedule resume <job_id> — toggle is_active
- Hot-reload: call
JobScheduler.add_job() directly so new jobs are live immediately without bot restart
Auto-populated fields
When creating via /schedule add:
job_id → auto-generated from name + random suffix
target_chat_ids → current chat ID
working_directory → user's active project directory
created_by → user's Telegram ID
Key files
run_application() — expose JobScheduler in bot deps
- New
ScheduleCommandHandler — command handler for /schedule
JobScheduler — minor API adjustments if needed
Problem
The scheduler backend (APScheduler + SQLite + EventBus) is fully functional, but there's no built-in user-facing interface to manage scheduled jobs. The current workaround is having Claude interact with the SQLite database directly via
sqlite3commands (possible since the bot runs on a VPS with CLI access), but this still requires a bot restart after every change and is a workaround rather than a proper solution.Expected behavior
Users should be able to create, list, and manage scheduled jobs directly from the Telegram chat using a
/schedulecommand.Current architecture
The
JobSchedulerclass already supportsadd_job(),remove_job(), andget_jobs(). It persists jobs to thescheduled_jobsSQLite table and loads them on startup. However, the instance is created locally inrun_application()and is not injected into bot dependencies, making it inaccessible from command handlers.Proposed solution
JobSchedulerinto bot dependencies alongsideClaudeIntegration,SessionManager, etc.ScheduleCommandHandlerregistered for/schedulewith subcommands:/schedule list— show all active jobs/schedule add <name> <cron> <prompt>— create a new job (auto-fillschat_id,working_directory,created_byfrom context)/schedule remove <job_id>— soft-delete a job/schedule pause <job_id>//schedule resume <job_id>— toggleis_activeJobScheduler.add_job()directly so new jobs are live immediately without bot restartAuto-populated fields
When creating via
/schedule add:job_id→ auto-generated from name + random suffixtarget_chat_ids→ current chat IDworking_directory→ user's active project directorycreated_by→ user's Telegram IDKey files
run_application()— exposeJobSchedulerin bot depsScheduleCommandHandler— command handler for/scheduleJobScheduler— minor API adjustments if needed