Skip to content

fix(scheduler): schedules added via CLI showing up in UI#7594

Merged
jamadeo merged 1 commit intoblock:mainfrom
Abhijay007:fix/cli-schedules-in-ui
Mar 2, 2026
Merged

fix(scheduler): schedules added via CLI showing up in UI#7594
jamadeo merged 1 commit intoblock:mainfrom
Abhijay007:fix/cli-schedules-in-ui

Conversation

@Abhijay007
Copy link
Copy Markdown
Collaborator

closes #7478

Summary

  • Bug fix

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

Tested by reproducing the bug

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +486 to +489
let to_add = disk_jobs
.into_iter()
.filter(|j| !jobs_guard.contains_key(&j.id))
.collect();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment on lines +490 to +493
let to_remove = jobs_guard
.iter()
.filter(|(id, (_, j))| !disk_ids.contains(*id) && !j.currently_running)
.map(|(id, (uuid, _))| (id.clone(), *uuid))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@jamadeo
Copy link
Copy Markdown
Collaborator

jamadeo commented Mar 2, 2026

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.

@Abhijay007
Copy link
Copy Markdown
Collaborator Author

Abhijay007 commented Mar 2, 2026

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.

@jamadeo
Copy link
Copy Markdown
Collaborator

jamadeo commented Mar 2, 2026

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 bua file watcher in goose server.

Oh I see, so list_scheduled_jobs is called on an interval? that is probably fine then

@Abhijay007
Copy link
Copy Markdown
Collaborator Author

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 bua 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.

Copy link
Copy Markdown
Collaborator

@jamadeo jamadeo left a comment

Choose a reason for hiding this comment

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

Sounds good, let's do it this way then, thanks @Abhijay007

@jamadeo jamadeo added this pull request to the merge queue Mar 2, 2026
Merged via the queue into block:main with commit 568ec98 Mar 2, 2026
19 checks passed
jh-block added a commit that referenced this pull request Mar 2, 2026
…d-output

* origin/main:
  Improve custom provider creation experience (#7541)
  fix(scheduler): schedules added via CLI showing up in UI (#7594)
wpfleger96 added a commit that referenced this pull request Mar 3, 2026
* 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)
  ...
lifeizhou-ap added a commit that referenced this pull request Mar 3, 2026
* 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)
  ...
tlongwell-block added a commit that referenced this pull request Mar 4, 2026
* 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)
craigwalkeruk pushed a commit to craigwalkeruk/custom-goose that referenced this pull request Mar 5, 2026
tlongwell-block added a commit that referenced this pull request Mar 5, 2026
* 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
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.

BUG: Schedules Added via CLI not showing up in Goose UI

2 participants