Enable scheduler write commands in agent mode#196
Conversation
…agent from CLI Add schedule.create, schedule.create-recurring, schedule.pause, schedule.resume, and schedule.delete to the agent-mode allowlist. Update tests to expect these commands as allowed. Remove dispatch_agent event type from the CLI create and create-recurring commands — the message-to-orchestrator pattern is the recommended approach for scheduled task dispatch.
There was a problem hiding this comment.
Code Review
This pull request enables schedule subcommands (create, create-recurring, pause, resume, and delete) for agents and simplifies schedule creation by removing the dispatch_agent event type and its associated flags (--template, --task, and --branch), leaving message as the only supported event type. The reviewer suggests making the --type flag optional (defaulting to "message") since it is now the only supported type, and updating the command descriptions and help text to reflect this change.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| Long: `Create a one-shot scheduled event. Requires --type message, timing (--in or --at), | ||
| --agent, and --message.`, |
There was a problem hiding this comment.
| Long: `Create a recurring schedule with a cron expression. Requires --name, --cron, | ||
| --type, and type-specific flags (e.g. --agent and --message for message events).`, | ||
| --type message, --agent, and --message.`, |
There was a problem hiding this comment.
If we make the --type flag optional (defaulting to "message"), we should update the command's long description to reflect that --type is optional and defaults to message.
Long: `Create a recurring schedule with a cron expression. Requires --name, --cron, --agent, and --message. --type defaults to message.`|
|
||
| // Create one-shot flags | ||
| scheduleCreateCmd.Flags().StringVar(&scheduleType, "type", "", "Event type (required: message, dispatch_agent)") | ||
| scheduleCreateCmd.Flags().StringVar(&scheduleType, "type", "", "Event type (required: message)") |
There was a problem hiding this comment.
Since "message" is now the only supported event type, requiring users to explicitly pass --type message is redundant and hurts usability. We can make the --type flag optional by defaulting it to "message" when it is not specified.
Note that because scheduleType is a shared package-level variable, we should not set the default value in StringVar (as it would interfere with schedule list's default behavior). Instead, we can safely default it inside the command runners.
Please update the flag registration help text here, and also update runScheduleCreate and runScheduleCreateRecurring to default scheduleType to "message" if it is empty:
if scheduleType == "" {
scheduleType = "message"
}| scheduleCreateCmd.Flags().StringVar(&scheduleType, "type", "", "Event type (required: message)") | |
| scheduleCreateCmd.Flags().StringVar(&scheduleType, "type", "", "Event type (default: message)") |
| scheduleCreateRecurringCmd.Flags().StringVar(&scheduleTask, "task", "", "Task/prompt for the agent (for dispatch_agent events)") | ||
| scheduleCreateRecurringCmd.Flags().StringVar(&scheduleBranch, "branch", "", "Git branch name (for dispatch_agent events)") | ||
| scheduleCreateRecurringCmd.Flags().StringVar(&scheduleCron, "cron", "", "Cron expression (required, 5-field: minute hour day month weekday, UTC)") | ||
| scheduleCreateRecurringCmd.Flags().StringVar(&scheduleType, "type", "", "Event type (required: message)") |
There was a problem hiding this comment.
Since "message" is now the only supported event type, we should make the --type flag optional by defaulting it to "message" when not specified.
Please update the help text here to reflect that it defaults to "message".
| scheduleCreateRecurringCmd.Flags().StringVar(&scheduleType, "type", "", "Event type (required: message)") | |
| scheduleCreateRecurringCmd.Flags().StringVar(&scheduleType, "type", "", "Event type (default: message)") |
Review feedback: with dispatch_agent removed, --type always has to be "message", so default it instead of requiring it. Remove the dead "--type is required" validation and update help text accordingly.
Closes #195
Summary
schedule.create,schedule.create-recurring,schedule.pause,schedule.resume, andschedule.deleteto the agent-mode allowlist incmd/cli_mode.godispatch_agentevent type from CLIschedule createandschedule create-recurringcommands — the message-to-orchestrator pattern is the recommended approachskills/scheduler/SKILL.mdcovering CLI commands, patterns, and gotchasTest plan
cli_mode_test.gotests pass with updated expectationsschedule create/create-recurringvalidation tests passdispatch_agenttype is rejected with clear error messagego build ./cmd/compiles clean