Skip to content

Fix cron dashboard trigger-now execution - #46956

Open
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix-46918-cron-trigger-now
Open

Fix cron dashboard trigger-now execution#46956
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix-46918-cron-trigger-now

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Fixes #46918.

Summary

  • make the dashboard trigger route tick the selected profile scheduler immediately instead of only updating next_run_at
  • reload the job after the tick so the API returns refreshed last_run_at and last_status
  • add regression coverage for scheduler profile routing and trigger-now run-history refresh

Verification

  • python3 -m py_compile hermes_cli/web_server.py tests/hermes_cli/test_web_server_cron_profiles.py
  • python3 -m pytest tests/hermes_cli/test_web_server_cron_profiles.py -q -o addopts=''
  • ruff check hermes_cli/web_server.py tests/hermes_cli/test_web_server_cron_profiles.py
  • git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/cron Cron scheduler and job management labels Jun 16, 2026
@alt-glitch alt-glitch added the comp/dashboard Web dashboard / control panel UI (dashboard/, landing) label Jun 26, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for isolating profile routing and adding regression coverage. The reported gap remains on current main: hermes_cli/web_server.py:10478-10485 only calls trigger_job, and cron/jobs.py:1428-1442 only updates next_run_at.

Problems

  • The proposed global CRON_DIR/JOBS_FILE/OUTPUT_DIR mutation conflicts with current profile-safe routing. Current main requires use_cron_store() for cross-profile calls (cron/jobs.py:67-69, 118-134) and scopes execution in _fire_cron_job_for_profile (hermes_cli/web_server.py:10511-10534).
  • scheduler.tick() processes every due job (cron/scheduler.py:3593) and defaults to synchronous completion (cron/scheduler.py:3747-3757), so this action can run unrelated jobs and block on agent execution.

Suggested changes

  • Route the selected job through _fire_cron_job_for_profile, preserve _run_cron_dashboard_io, then reload that job for the response.
  • Replace the mocked tick regression with coverage for current profile context, selected-job-only firing, and refreshed run state.

Automated hermes-sweeper review.

Comment thread hermes_cli/web_server.py
old_jobs_file = cron_jobs.JOBS_FILE
old_output_dir = cron_jobs.OUTPUT_DIR
old_scheduler_home = cron_scheduler._hermes_home
cron_jobs.CRON_DIR = home / "cron"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current main deliberately makes these globals fallback-only and routes cross-profile calls through use_cron_store() to avoid retargeting concurrent ticker I/O (cron/jobs.py:67-69, 118-134). Please rework this around the existing profile-scoped _fire_cron_job_for_profile path instead of restoring process-global routing.

Comment thread hermes_cli/web_server.py
_call_cron_scheduler_for_profile(selected, "tick")
refreshed = _call_cron_for_profile(selected, "get_job", job_id)
return refreshed or job

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tick() fires every due job, not just this job (cron/scheduler.py:3593), and its default synchronous mode waits for all dispatched jobs (cron/scheduler.py:3747-3757). This route should fire only the selected job through the existing profile-safe helper.

@teknium1 teknium1 added sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/cron Cron scheduler and job management comp/dashboard Web dashboard / control panel UI (dashboard/, landing) P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cron jobs dashboard: "Trigger now" button doesn't execute job, Run History shows "No runs yet"

3 participants