-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Fix: exclude platform_schedule_tool in CLI #6442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes the "Scheduler not available" error in CLI mode by conditionally including the schedule management tool only when a scheduler service is present. The PR also standardizes the scheduler storage filename from schedules.json to schedule.json throughout the codebase.
Changes:
- Added scheduler availability check before including the schedule management tool in the available tools list
- Updated error message in schedule tool handler to reflect that it should only be called when scheduler is available
- Standardized scheduler storage filename to
schedule.json(singular) across all files - Refactored CLI schedule commands to use a shared helper function for creating scheduler instances
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/goose/src/agents/agent.rs | Added scheduler service availability check in list_tools to conditionally include schedule management tool |
| crates/goose/src/agents/schedule_tool.rs | Updated error message to reflect internal assertion rather than user-facing error |
| crates/goose/src/agents/platform_tools.rs | Updated tool description to clarify it manages "Goose's internal scheduled recipe execution" |
| crates/goose/src/scheduler.rs | Standardized storage filename to schedule.json and improved error logging with path display |
| crates/goose/src/execution/manager.rs | Refactored to use get_default_scheduler_storage_path() helper function |
| crates/goose/src/session/diagnostics.rs | Removed duplicate schedules.json reference, keeping only schedule.json |
| crates/goose-cli/src/commands/schedule.rs | Added create_scheduler() helper function to reduce code duplication |
| crates/goose/tests/agent.rs | Updated tests to verify tool is not available without scheduler and added scheduler setup to tests requiring it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
| - "delete": Remove a Goose scheduled job | ||
| - "kill": Terminate a currently running Goose scheduled job | ||
| - "inspect": Get details about a running Goose scheduled job | ||
| - "sessions": List execution history for a Goose scheduled job |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goose should not be capitalized. why is this change happening?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am sorry that I forgot to mention this change in the PR summary. In the original issue, user has some prompts related to k8s that could be related to schedule and agent triggers the platform_schedule_tool. I guess the agent got confused with k8s scheduler with goose scheduler. That's why I added goose in the tool description, so that the agent won't use this tool when having the context with non goose schedule.
I will change to the goose instead of Goose
| let (tools, _toolshim_tools, _system_prompt) = | ||
| agent.prepare_tools_and_prompt(&working_dir).await?; | ||
|
|
||
| // Ensure both platform and frontend tools are present |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or just delete this test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the code, it seems it still worthwhile to use this test to test the ordering of the tools. I changed the test name to reflect the purpose of this test.
| LONG_RESPONSE_PROMPT="Count from 1 to 200, one number per line." | ||
|
|
||
| echo "Step 1: Creating session with first message (generating tokens for threshold)..." | ||
| (cd "$TESTDIR" && "$GOOSE_BIN" run --text "$LONG_RESPONSE_PROMPT" 2>&1) | tee "$OUTPUT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happened here? from a different branch maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we removed the platform_schedule_tool from CLI, the context usage is getting smaller and the original test prompt cannot reach to the context size to trigger the compact. So I changed the prompt to generate a bit longer response so that it reached to the threshold of 0.5% to trigger the compact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
| ErrorData::new( | ||
| ErrorCode::INTERNAL_ERROR, | ||
| "Scheduler not available. This tool only works in server mode.".to_string(), | ||
| "Scheduler service should be available when schedule tool is called" |
Copilot
AI
Jan 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message will never be seen by users since the tool is now only added when the scheduler is available. Consider removing the defensive check or updating the error to indicate this is an internal error (bug) if it ever triggers.
…ased * 'main' of github.com:block/goose: (23 commits) Use Intl.NumberFormat for token formatting in SessionsInsights (#6466) feat(ui): format large and small token counts for readability (#6449) fix: apply subrecipes when using slash commands (#6460) Fix: exclude platform_schedule_tool in CLI (#6442) Fix: Small update in how ML-based prompt injection determines final result (#6439) docs: remove SSE transport and rename to Streamable HTTP (#6319) fix: correct Cloudinary extension command and env variable (#6453) fix: add gap between buttons in MacDesktopInstallButtons.js (#6452) refactor: include hidden dotfiles folders in file picker search (#6315) upgraded safe npm packages (#6450) chore(deps): bump react-router and react-router-dom in /ui/desktop (#6408) chore(deps): bump lru from 0.12.5 to 0.16.3 (#6379) chore(deps-dev): bump @modelcontextprotocol/sdk from 1.24.0 to 1.25.2 in /ui/desktop (#6375) fix: inconsistent API url requirement between desktop and CLI versions (#6419) feat(vertexai): Add streaming support (#6409) fix deeplink recipe launch cold start (#6210) Spell check setting (#6446) File bug directly (#6413) fix(cli): incorrect bin name in shell completions (#6444) Use crunchy from crates instead of git fork (#6415) ...
* main: (41 commits) Allow customizing the new line keybinding in the CLI (#5956) Ask for permission in the CLI (#6475) docs: add Ralph Loop tutorial for multi-model iterative development (#6455) Remove gitignore fallback from gooseignore docs (#6480) fix: clean up result recording for code mode (#6343) fix(code_execution): handle model quirks with tool calls (#6352) feat(ui): support prefersBorder option for MCP Apps (#6465) fixed line breaks (#6459) Use Intl.NumberFormat for token formatting in SessionsInsights (#6466) feat(ui): format large and small token counts for readability (#6449) fix: apply subrecipes when using slash commands (#6460) Fix: exclude platform_schedule_tool in CLI (#6442) Fix: Small update in how ML-based prompt injection determines final result (#6439) docs: remove SSE transport and rename to Streamable HTTP (#6319) fix: correct Cloudinary extension command and env variable (#6453) fix: add gap between buttons in MacDesktopInstallButtons.js (#6452) refactor: include hidden dotfiles folders in file picker search (#6315) upgraded safe npm packages (#6450) chore(deps): bump react-router and react-router-dom in /ui/desktop (#6408) chore(deps): bump lru from 0.12.5 to 0.16.3 (#6379) ...
Summary
Fixed "Scheduler not available" error in issue #6405
Changes:
Exclude schedule tool in CLI mode - Only add platform__manage_schedule tool when scheduler is available. In CLI mode, there's no persistent scheduler service running, so the tool would fail if the LLM tried to use it.
Unified schedule file - CLI and Desktop now both use schedule.json (was using different files). Using schedule.json because Desktop users already have data in this file for scheduled job. For
schedules.jsoncreated by CLI, the data in this file are not used to execute the recipe with schedule, it only used inrun nowwhich triggers the job manually. Losing this data has very minimal user impact.Refactoring: create_scheduler() helper to reduce duplication
Improved tool description - Added "Goose" to description and all actions to prevent confusion with external schedulers
Type of Change
AI Assistance
Testing
Unit test and Manually Testing