fix(desktop): per-job model picker for cron editor - #67467
Conversation
teknium1
left a comment
There was a problem hiding this comment.
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 toprofile="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 sendsmodelandprovider(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, |
There was a problem hiding this comment.
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.
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.
25205be to
0582f6e
Compare
|
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. |
Summary
model/providerfields; show the pinned model in job detail.Test plan
provider · modeland the next run uses that pin.apps/desktop:npx vitest run src/app/cron/cron-job-model.test.tsInfographic