Skip to content

fix(desktop): per-job model picker for cron editor - #67467

Closed
HexLab98 wants to merge 2 commits into
NousResearch:mainfrom
HexLab98:feat/desktop-cron-job-model-picker
Closed

fix(desktop): per-job model picker for cron editor#67467
HexLab98 wants to merge 2 commits into
NousResearch:mainfrom
HexLab98:feat/desktop-cron-job-model-picker

Conversation

@HexLab98

@HexLab98 HexLab98 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add an optional Model field to the Desktop New/Edit cron job dialog so each scheduled job can pin a provider/model (or keep Default to follow the profile).
  • Wire create/update payloads through the existing cron REST model/provider fields; show the pinned model in job detail.
  • Localize the new labels across en/zh/zh-hant/ja.

Test plan

  • Open Desktop Cron → New cron job; confirm a Model select appears under Frequency/Deliver.
  • Leave Model on Default, create a job; confirm the job has no pinned model and still runs on the profile default.
  • Create another job pinned to a non-default model; confirm detail shows provider · model and the next run uses that pin.
  • Edit a pinned job back to Default; confirm the pin clears on save.
  • Script-only jobs hide the Model field.
  • From apps/desktop: npx vitest run src/app/cron/cron-job-model.test.ts

Infographic

Desktop cron per-job model picker

@alt-glitch alt-glitch added type/feature New feature or request comp/desktop Electron desktop app (apps/desktop/*) comp/cron Cron scheduler and job management P3 Low — cosmetic, nice to have needs-decision Awaiting maintainer decision before any implementation labels Jul 19, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related to #49948: both add Desktop per-job provider/model selection. #49948 also carries cron/API/profile plumbing, while this branch is a newer focused editor implementation with different selection and clearing behavior. Please choose a consolidation path.

@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 filling a real Desktop gap: current main's cron editor cannot send model/provider even though the REST create schema accepts both (apps/desktop/src/app/cron/index.tsx:388-405; hermes_cli/web_server.py:10419-10427, :10739-10749).

Problems

  • The picker loads active-profile model data through getGlobalModelOptions() (apps/desktop/src/hermes.ts:1010-1014), but cron list/create/update calls remain unscoped (apps/desktop/src/hermes.ts:869-903). The create endpoint defaults to profile="default" (hermes_cli/web_server.py:10763-10765), so a non-default profile can select a valid local model and save the job into a different profile.
  • cronEditorUpdates() always sends model and provider (apps/desktop/src/app/cron/cron-job-model.ts:211-213). The dialog hides this control for script-only jobs (apps/desktop/src/app/cron/index.tsx:772-773), so saving one clears stored pins without an editable field.

Suggested changes

  • Scope every Desktop cron API request with profileScoped() and cover non-default-profile request routing.
  • Skip model/provider updates for script-only jobs and assert preservation in the helper tests.
  • Please reconcile this implementation with the maintainer-linked open #49948, which already includes cron profile routing work.

Automated hermes-sweeper review.

schedule: values.schedule.trim()
schedule: values.schedule.trim(),
// Always send inference pins so switching back to Default clears a prior pin.
model: values.model?.trim() || null,

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.

This runs for script-only edits too, even though the dialog hides the Model field. Saving a script-only job will therefore clear its stored inference pins without user intent. Gate both inference fields on !options.scriptOnlyJob, and add a preservation test.

@teknium1 teknium1 added sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state 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 19, 2026
HexLab98 added 2 commits July 19, 2026 18:56
Let users pin a model (or keep the profile default) when creating or
editing a Desktop cron job. Scope cron REST calls with profileScoped()
so non-default profiles write jobs to the active profile, and skip
model/provider updates on script-only saves so hidden UI cannot clear pins.
Prove encode/decode, catalog flattening, create/update payloads,
script-only pin preservation, and non-default profile routing on
list/create/update.
@HexLab98
HexLab98 force-pushed the feat/desktop-cron-job-model-picker branch from 25205be to 0582f6e Compare July 19, 2026 11:56
@HexLab98 HexLab98 closed this Jul 19, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks @HexLab98 for the contribution — this landed on main via #67472 (merged today, same feature: grouped provider/model picker fed by the model.options catalog, default-clears-pin semantics, script-only jobs excluded, 4 locales). The script-only concern from the sweeper review is covered there, and the profile-scoping gap is addressed in the follow-up #67493. Closing as superseded — appreciate the quick turnaround on the community request.

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

Labels

comp/cron Cron scheduler and job management comp/desktop Electron desktop app (apps/desktop/*) needs-decision Awaiting maintainer decision before any implementation 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-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants