fix(scheduler): schedules added via CLI showing up in UI#7594
fix(scheduler): schedules added via CLI showing up in UI#7594jamadeo merged 1 commit intoblock:mainfrom
Conversation
Signed-off-by: Abhijay007 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ed7ad7b29
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| let to_add = disk_jobs | ||
| .into_iter() | ||
| .filter(|j| !jobs_guard.contains_key(&j.id)) | ||
| .collect(); |
There was a problem hiding this comment.
Prevent sync from resurrecting jobs during deletion
This sync path can undo successful deletes when requests overlap: remove_scheduled_job removes from self.jobs before it persists the updated file, so a concurrent list_scheduled_jobs call can read the old disk snapshot and include that ID in to_add, which re-registers the job in memory and scheduler. In practice, a /schedule/delete racing with /schedule/list (the UI polls list periodically) can report success but leave the schedule present.
Useful? React with 👍 / 👎.
| let to_remove = jobs_guard | ||
| .iter() | ||
| .filter(|(id, (_, j))| !disk_ids.contains(*id) && !j.currently_running) | ||
| .map(|(id, (uuid, _))| (id.clone(), *uuid)) |
There was a problem hiding this comment.
Avoid removing newly added jobs from in-memory state
This removal rule can drop newly created schedules under concurrent traffic: add_scheduled_job inserts into self.jobs before persist_jobs writes disk, and if list_scheduled_jobs runs in that window, sync_from_storage will see the new ID missing from file and enqueue it for removal here. That makes create operations intermittently disappear even though the add call returned Ok(()).
Useful? React with 👍 / 👎.
|
Thanks for the fix @Abhijay007 , but I wonder if maybe this is better done with a directory/file watcher in the goose server. That way the user doesn't have to refresh their list view for the scheduler itself to pick up a new item. |
It shows us after 15 sec without refresh or restarting, but yea let me look into possibility of doing it by file watcher in goose server. |
Oh I see, so list_scheduled_jobs is called on an interval? that is probably fine then |
Yes. The UI already polls GET /schedule/list every 15 seconds, so the server’s list_scheduled_jobs() runs on that interval. The change only makes that call sync from disk before returning, so new CLI-added schedules show up on the next poll without any refresh. |
jamadeo
left a comment
There was a problem hiding this comment.
Sounds good, let's do it this way then, thanks @Abhijay007
* origin/main: (27 commits)
feat: return structured {stdout, stderr} from shell tool with output schema (#7604)
Improve custom provider creation experience (#7541)
fix(scheduler): schedules added via CLI showing up in UI (#7594)
chore: openai reasoning model cleanup (#7529)
chore(deps): bump hono from 4.12.1 to 4.12.3 in /evals/open-model-gym/mcp-harness (#7585)
chore(deps): bump minimatch from 10.1.1 to 10.2.3 in /evals/open-model-gym/suite (#7498)
chore(deps): bump swiper from 11.2.10 to 12.1.2 in /documentation (#7368)
Better network failure error & antrhopic retry (#7595)
feat: make the text bar persistent and add a queue for messages (#7560)
fix: outdated clippy command in goosehints (#7590)
chore(deps): bump hono from 4.11.7 to 4.12.1 in /evals/open-model-gym/mcp-harness (#7417)
chore(deps-dev): bump ajv from 6.12.6 to 6.14.0 in /ui/desktop (#7437)
chore(deps): bump ajv from 8.17.1 to 8.18.0 in /evals/open-model-gym/mcp-harness (#7491)
chore(deps): bump hono from 4.12.0 to 4.12.2 in /ui/desktop (#7515)
chore(deps-dev): bump rollup from 4.57.1 to 4.59.0 in /ui/desktop (#7522)
chore(deps): bump minimatch in /ui/desktop (#7572)
fix: validate configure probe for streaming providers (#7564)
Dockerfile: add missing build/runtime dependencies (#7546)
fix(claude-code): Permission routing for smart-approve (#7501)
Add base_path field to custom provider config (#7558)
...
* main: (74 commits)
feat: return structured {stdout, stderr} from shell tool with output schema (#7604)
Improve custom provider creation experience (#7541)
fix(scheduler): schedules added via CLI showing up in UI (#7594)
chore: openai reasoning model cleanup (#7529)
chore(deps): bump hono from 4.12.1 to 4.12.3 in /evals/open-model-gym/mcp-harness (#7585)
chore(deps): bump minimatch from 10.1.1 to 10.2.3 in /evals/open-model-gym/suite (#7498)
chore(deps): bump swiper from 11.2.10 to 12.1.2 in /documentation (#7368)
Better network failure error & antrhopic retry (#7595)
feat: make the text bar persistent and add a queue for messages (#7560)
fix: outdated clippy command in goosehints (#7590)
chore(deps): bump hono from 4.11.7 to 4.12.1 in /evals/open-model-gym/mcp-harness (#7417)
chore(deps-dev): bump ajv from 6.12.6 to 6.14.0 in /ui/desktop (#7437)
chore(deps): bump ajv from 8.17.1 to 8.18.0 in /evals/open-model-gym/mcp-harness (#7491)
chore(deps): bump hono from 4.12.0 to 4.12.2 in /ui/desktop (#7515)
chore(deps-dev): bump rollup from 4.57.1 to 4.59.0 in /ui/desktop (#7522)
chore(deps): bump minimatch in /ui/desktop (#7572)
fix: validate configure probe for streaming providers (#7564)
Dockerfile: add missing build/runtime dependencies (#7546)
fix(claude-code): Permission routing for smart-approve (#7501)
Add base_path field to custom provider config (#7558)
...
* origin/main:
feat: return structured {stdout, stderr} from shell tool with output schema (#7604)
Improve custom provider creation experience (#7541)
fix(scheduler): schedules added via CLI showing up in UI (#7594)
chore: openai reasoning model cleanup (#7529)
chore(deps): bump hono from 4.12.1 to 4.12.3 in /evals/open-model-gym/mcp-harness (#7585)
chore(deps): bump minimatch from 10.1.1 to 10.2.3 in /evals/open-model-gym/suite (#7498)
chore(deps): bump swiper from 11.2.10 to 12.1.2 in /documentation (#7368)
Better network failure error & antrhopic retry (#7595)
feat: make the text bar persistent and add a queue for messages (#7560)
Signed-off-by: Abhijay007 <[email protected]>
* origin/main: (107 commits) Merge platform/builtin extensions (#7630) Clean up stale references to removed components (#7644) fix: scope empty session reuse to current window to prevent session mixing (#7602) fix: prevent abort in local inference (#7633) Revert git patch for llama-cpp-2 (#7642) docs: update recipe usage step to reflect auto-submit behavior (#7639) docs: add guide for customizing the sidebar (#7638) docs: update Claude Code approve behavior and model list in cli-providers guide (#7448) fix: restore provider and extensions for LRU-evicted sessions (#7616) Restore goosed logging (#7622) feat: return structured {stdout, stderr} from shell tool with output schema (#7604) Improve custom provider creation experience (#7541) fix(scheduler): schedules added via CLI showing up in UI (#7594) chore: openai reasoning model cleanup (#7529) chore(deps): bump hono from 4.12.1 to 4.12.3 in /evals/open-model-gym/mcp-harness (#7585) chore(deps): bump minimatch from 10.1.1 to 10.2.3 in /evals/open-model-gym/suite (#7498) chore(deps): bump swiper from 11.2.10 to 12.1.2 in /documentation (#7368) Better network failure error & antrhopic retry (#7595) feat: make the text bar persistent and add a queue for messages (#7560) fix: outdated clippy command in goosehints (#7590) ... # Conflicts: # Cargo.lock # Cargo.toml # crates/goose-server/src/commands/agent.rs # crates/goose-server/src/main.rs # crates/goose-server/src/routes/reply.rs
closes #7478
Summary
AI Assistance
Testing
Tested by reproducing the bug