Add cron-based scheduling with prompt templates integration (#164)

This commit is contained in:
Chris Scott authored and GitHub committed 2026-03-21 23:33:03 -04:00
1 parent cbd0ee2958
commit 1e863c5fc5
63 files changed
+7797 -64

No files matched your search

+10 -1
View File
@@ -33,6 +33,16 @@ OpenCode Manager provides a comprehensive web interface for managing OpenCode AI
[Learn more →](chat.md)
### Schedules & Recurring Jobs
- **Recurring Repo Jobs** - Run reusable prompts against a repository on an interval or cron schedule
- **Prompt Templates** - Start with built-in reviews for repo health, dependencies, release readiness, docs drift, and more
- **Run History** - Inspect statuses, logs, errors, and assistant output from past runs
- **Session Handoff** - Open the linked OpenCode session for any run and continue from there
- **Manual Runs** - Trigger the same job on demand when you want a fresh report immediately
[Learn more →](schedules.md)
### AI Configuration
- **Model Selection** - Browse and filter available AI models
@@ -95,4 +105,3 @@ OpenCode Manager provides a comprehensive web interface for managing OpenCode AI
- **Customizable** - Control which events trigger notifications
[Learn more →](notifications.md)
+119
View File
@@ -0,0 +1,119 @@
# Schedules & Recurring Jobs
Create recurring repo jobs that run reusable prompts against a repository, store run history, and link every run back to a normal OpenCode session.
## What Schedules Are Good For
Schedules make OpenCode Manager proactive instead of purely session-driven. Good examples include:
- **Repo health reports** for a quick morning review
- **Dependency watchlists** to catch upgrade pressure early
- **Release readiness checks** before a ship window
- **Docs drift reviews** to spot stale setup instructions
- **Tech debt triage** for recurring cleanup planning
Each run is stored with status, timestamps, logs, assistant output, and a linked session you can open and continue.
## Creating a Schedule
1. Open a repository
2. Click **Schedules**
3. Click **New Schedule**
4. Configure the job name, prompt, timing, and optional overrides
5. Save the schedule
The schedule is scoped to the current repository.
## Timing Options
The schedule builder supports both simple presets and advanced cron:
- **Interval** - Repeat every N minutes
- **Hourly** - Run once each hour at a chosen minute
- **Daily** - Run once per day at a chosen time
- **Weekdays** - Run Monday through Friday
- **Weekly** - Pick one or more weekdays and a time
- **Monthly** - Run on a day of the month
- **Advanced** - Enter a cron expression directly
Cron-based schedules also store a timezone so runs happen when expected.
## Prompt Templates
Built-in prompt templates help you start quickly with recurring jobs like:
- Repo health report
- Dependency watchlist
- Release readiness review
- Test stability audit
- Docs drift review
- Tech debt triage
- Security and config review
- CI and ops review
Applying a template fills the schedule name, description, and prompt so you can customize from a strong default instead of starting from scratch.
## Agent and Model Overrides
Schedules can run with:
- the default workspace agent and model
- a custom agent slug
- a specific model override when needed
If a requested model is no longer available, OpenCode Manager falls back to a valid configured model for that provider so the run can still start when possible.
## Run History
Each schedule stores a run history panel with:
- **Status** - Running, completed, or failed
- **Trigger source** - Manual or scheduled
- **Log output** - Execution metadata and captured results
- **Assistant output** - Rendered markdown preview and raw markdown
- **Errors** - Failure details when a run does not complete
This makes recurring jobs easy to review without digging through raw session data first.
## Linked Sessions
Every run creates or attaches to a normal OpenCode session.
Use **Open session** when you want to:
- inspect the original conversation
- continue from the generated report
- answer follow-up questions from the agent
- debug provider, permission, or tool issues
This keeps automation connected to the rest of the OpenCode Manager workflow instead of creating a separate silo.
## Best Practices
- Keep prompts focused on one recurring outcome
- Prefer a few high-value schedules per repo over many overlapping jobs
- Use manual runs to validate a prompt before relying on the schedule
- Review failed runs quickly so broken provider or permission setups do not go unnoticed
- Treat schedules as reusable repo routines, not long-running background workers
## Troubleshooting
### Run Failed
1. Open the run from **Run History**
2. Check the **Error** tab for the failure message
3. Use **Open session** to inspect the underlying session
4. Verify provider credentials, model availability, and any pending agent questions or permissions
### No Assistant Output
If a run starts but does not produce assistant output:
1. Open the linked session
2. Check for a provider error
3. Check whether the agent asked a question or needed permission
4. Re-run the schedule manually after fixing the issue
### Prompt Needs Iteration
Use **Run now** to test prompt changes immediately before waiting for the next scheduled run.
Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

+3
View File
@@ -21,6 +21,7 @@ OpenCode Manager provides a web-based interface for OpenCode AI agents, allowing
- **Manage repositories** - Clone repos or discover existing local repos from a parent folder
- **Chat with AI** - Real-time streaming chat with file mentions and slash commands
- **Run recurring jobs** - Schedule repo reviews, health checks, and other reusable prompts
- **View diffs** - See code changes with syntax highlighting
- **Control from anywhere** - Mobile-first PWA with push notifications
- **Configure AI** - Manage models, providers, and MCP servers
@@ -30,6 +31,7 @@ OpenCode Manager provides a web-based interface for OpenCode AI agents, allowing
- **Multi-Repository Support** - Clone repos, discover local repo folders, and reconnect existing OpenCode chats
- **Git Integration** - View diffs, manage branches, create PRs directly from the UI
- **Real-time Chat** - Stream responses with file mentions and custom slash commands
- **Scheduled Repo Jobs** - Run recurring prompts with linked sessions, logs, and reviewable output
- **Mobile-First PWA** - Install as an app on any device with push notifications
- **Push Notifications** - Get background alerts for agent events when app is closed
- **AI Configuration** - Configure models, providers, OAuth, and custom agents
@@ -46,5 +48,6 @@ OpenCode Manager provides a web-based interface for OpenCode AI agents, allowing
- [Installation Guide](getting-started/installation.md) - Detailed setup instructions
- [Quick Start](getting-started/quickstart.md) - Get up and running fast
- [Features Overview](features/overview.md) - Explore all features
- [Schedules & Recurring Jobs](features/schedules.md) - Automate recurring repo reviews and follow-ups
- [Memory Plugin](features/memory.md) - Persistent project knowledge with semantic search
- [Configuration](configuration/environment.md) - Environment variables and setup