Skip to content

feat(tasks): add scheduled job profile selector#1674

Closed
Michaelyklam wants to merge 1 commit into
nesquena:masterfrom
Michaelyklam:feat/issue-617-task-profile-selector
Closed

feat(tasks): add scheduled job profile selector#1674
Michaelyklam wants to merge 1 commit into
nesquena:masterfrom
Michaelyklam:feat/issue-617-task-profile-selector

Conversation

@Michaelyklam
Copy link
Copy Markdown
Contributor

@Michaelyklam Michaelyklam commented May 5, 2026

Thinking Path

  • Scheduled jobs already have rich per-job settings, but profile selection was invisible and process-global.
  • Multi-profile users need to know whether a job uses the WebUI server default profile or an explicit profile.
  • The smallest WebUI-side fix is to persist an optional profile field, validate it against /api/profiles, show it in the Tasks UI, and route WebUI “Run now” through the selected profile home.
  • Legacy jobs keep profile: null at the API boundary so the UI can label them as “server default” without changing stored legacy behavior.
  • This gets the UI/API/control-plane pieces in place while calling out the remaining scheduler-daemon boundary separately.

What Changed

  • Added cron job profile API helpers so /api/crons returns profile, create/update validate profile names, and legacy blank values normalize to server-default behavior.
  • Updated WebUI manual cron runs to execute under a selected job profile home while saving output/run metadata back to the job-owning cron store.
  • Extended profile context patching to include cron.scheduler globals that read profile-specific config/env paths during run_job().
  • Added a Tasks-panel profile selector populated from /api/profiles, profile badges in the scheduled-job list/detail view, and locale strings for all shipped locales.
  • Added regression coverage for API serialization/validation/persistence hooks, manual-run profile routing, UI selector/badge hooks, and the existing cron profile isolation source assertion.
  • Added UI evidence screenshots under docs/pr-media/617/.

Why It Matters

Users with multiple Hermes profiles can now create/edit scheduled jobs with explicit profile intent and audit that intent from the job list. Existing jobs remain safe: jobs without a persisted profile are still treated as the WebUI server default and are labeled that way instead of silently pretending they are tied to a concrete profile.

Verification

node --check static/panels.js
node --check static/i18n.js
env -u HERMES_CONFIG_PATH /home/michael/.hermes/hermes-agent/venv/bin/python -m pytest tests/test_issue617_cron_profile_selector.py tests/test_cron_manual_run_persistence.py tests/test_cron_run_job_import.py tests/test_scheduled_jobs_profile_isolation.py tests/test_chinese_locale.py::test_chinese_locale_covers_english_keys tests/test_japanese_locale.py::test_japanese_locale_covers_english_keys tests/test_russian_locale.py::test_russian_locale_covers_english_keys tests/test_spanish_locale.py::test_spanish_locale_covers_english_keys tests/test_sprint3.py::test_skills_list tests/test_sprint3.py::test_skills_list_has_required_fields -q
git diff --check

Result:

23 passed in 2.14s

GitHub Actions full-suite signal:

test (3.11): pass
test (3.12): pass
test (3.13): pass

Local full-suite attempts were also made with env -u HERMES_CONFIG_PATH /home/michael/.hermes/hermes-agent/venv/bin/python -m pytest tests/ -q; the final local broad run was inconclusive because the isolated test server exited mid-suite and caused a connection-refused cascade. CI completed the broad matrix successfully.

Manual browser verification on an isolated local WebUI server:

  • Confirmed scheduled-job list shows a server default badge for legacy jobs and default for explicit-profile jobs.
  • Confirmed New Job form includes a Profile selector with server default, default (default), and an additional research profile option from /api/profiles.
  • Confirmed local /health stayed OK during the isolated UI check.

UI media:

Risks / Follow-ups

  • Refs feat(tasks): per-job profile selector — scheduled jobs have no profile association #617 rather than closing it outright: this PR wires WebUI create/edit/list/manual-run behavior, but automatic scheduler ticks are owned by Hermes Agent cron.scheduler.tick() outside the WebUI repository. That scheduler will need native per-job profile handling before timed executions can be guaranteed to use the selected profile without the WebUI manual-run wrapper.
  • If reviewers prefer not to expose both server default and default, the wording can be adjusted; the distinction is intentional here because a legacy job and an explicitly selected default-profile job are different persisted states.
  • CI completed the full test matrix successfully; one local broad-suite run was inconclusive because the isolated test server exited mid-suite, but targeted coverage and browser validation passed locally.

Model Used

AI assisted.

  • Provider: OpenAI Codex
  • Model: gpt-5.5
  • Notable tool use: terminal/git/gh, pytest, node syntax checks, isolated browser QA, screenshot capture

@nesquena-hermes nesquena-hermes added ux User experience / visual polish and removed ux User experience / visual polish labels May 5, 2026
@nesquena-hermes
Copy link
Copy Markdown
Collaborator

Closed by the v0.51.1 release in PR #1681 (merged at e23ba59). Massive thanks @Michaelyklam — this is now 19 merged PRs across the v0.50.292–v0.51.1 release window, an extraordinary contribution rate. Each PR was per-claim-vs-diff verified against your description and every security-relevant code path checked under independent review (Opus advisor, 6/6 questions clean). Your closes #N references are all accurate, your Thinking Path / What Changed / Why It Matters body template is consistently helpful, and your test coverage is solid behavioral scope (not source-string scaffolding) on every PR.

Live on production: https://github.com/nesquena/hermes-webui/releases/tag/v0.51.1

🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants