Skip to content

Enable scheduler write commands in agent mode#196

Open
ptone wants to merge 2 commits into
mainfrom
scion/agent-scheduler-use
Open

Enable scheduler write commands in agent mode#196
ptone wants to merge 2 commits into
mainfrom
scion/agent-scheduler-use

Conversation

@ptone

@ptone ptone commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Closes #195

Summary

  • Add schedule.create, schedule.create-recurring, schedule.pause, schedule.resume, and schedule.delete to the agent-mode allowlist in cmd/cli_mode.go
  • Update all agent-mode tests to expect these commands as allowed
  • Remove dispatch_agent event type from CLI schedule create and schedule create-recurring commands — the message-to-orchestrator pattern is the recommended approach
  • Write scheduler skill doc at skills/scheduler/SKILL.md covering CLI commands, patterns, and gotchas

Test plan

  • All existing cli_mode_test.go tests pass with updated expectations
  • schedule create/create-recurring validation tests pass
  • Built binary shows all 9 schedule subcommands in agent mode
  • dispatch_agent type is rejected with clear error message
  • go build ./cmd/ compiles clean

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread cmd/schedule.go Outdated
Comment on lines +77 to +78
Long: `Create a one-shot scheduled event. Requires --type message, timing (--in or --at),
--agent, and --message.`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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 one-shot scheduled event. Requires timing (--in or --at), --agent, and --message. --type defaults to message.`,

Comment thread cmd/schedule.go Outdated
Comment on lines +86 to +87
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.`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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

Comment thread cmd/schedule.go Outdated

// Create one-shot flags
scheduleCreateCmd.Flags().StringVar(&scheduleType, "type", "", "Event type (required: message, dispatch_agent)")
scheduleCreateCmd.Flags().StringVar(&scheduleType, "type", "", "Event type (required: message)")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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"
}
Suggested change
scheduleCreateCmd.Flags().StringVar(&scheduleType, "type", "", "Event type (required: message)")
scheduleCreateCmd.Flags().StringVar(&scheduleType, "type", "", "Event type (default: message)")

Comment thread cmd/schedule.go Outdated
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)")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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

Suggested change
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.
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.

Enable scheduler write commands in agent mode

1 participant