Skip to content

feat(cron): add manual run support for management API and Web UI#538

Open
Aokoooooo wants to merge 1 commit intochenhg5:mainfrom
Aokoooooo:feat/run-cron
Open

feat(cron): add manual run support for management API and Web UI#538
Aokoooooo wants to merge 1 commit intochenhg5:mainfrom
Aokoooooo:feat/run-cron

Conversation

@Aokoooooo
Copy link
Copy Markdown

@Aokoooooo Aokoooooo commented Apr 10, 2026

Summary

Add manual cron run support across the remaining management surfaces so saved cron jobs can be triggered immediately from the daemon management API, CLI, and Web UI.

This keeps the execution path unified by reusing the existing scheduler/job configuration instead of introducing a separate ad-hoc runner.

Closes #537

Context

There is already an existing feature request for manual cron execution in #263 and an overlapping PR #357 focused on the core CLI/chat execution flow.

This branch extends the feature through the management surface area and admin UI so the capability is available consistently for daemon/API/Web users as well.

What Changed

  • add cc-connect cron run <id> in the CLI help and command handling
  • add CronScheduler.RunJobNow(id) and explicit not-found / project-unavailable errors
  • add /cron run <id> handling in the engine with localized success and error messages
  • add management API support for POST /api/v1/cron/{id}/run
  • document the new management API endpoint in English and Chinese docs
  • add a Run button in the Web cron list and wire it to the cron API client
  • update i18n strings for API/UI feedback across supported locales
  • add regression coverage for scheduler, engine command handling, API, management API, and CLI usage

Why

Today the manual cron trigger flow is incomplete for users who manage cc-connect through the daemon API or Web admin page.

Without this, users have to wait for the next schedule, temporarily re-enable a disabled job, or switch over to another entrypoint just to run one saved task once.

This PR makes manual triggering available from the same saved cron job definition while preserving project, session, timeout, and silent/session-mode behavior.

Validation

  • go test ./core
  • go test ./cmd/cc-connect
  • go test ./....

Notes

@Aokoooooo Aokoooooo marked this pull request as ready for review April 10, 2026 06:04
Copy link
Copy Markdown
Owner

@chenhg5 chenhg5 left a comment

Choose a reason for hiding this comment

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

LGTM. Manual cron run via CLI subcommand and API endpoint — useful for ops. Socket existence check before call is a good guard.

PR: #538

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.

[Feature] support manual cron run from management API and Web UI

2 participants