Skip to content

Feature/migrate im channel cronjob from ace - #201

Open
liukewia wants to merge 7 commits into
TencentCloud:developfrom
liukewia:feature/migrate-im-channel-cronjob-from-ace
Open

Feature/migrate im channel cronjob from ace#201
liukewia wants to merge 7 commits into
TencentCloud:developfrom
liukewia:feature/migrate-im-channel-cronjob-from-ace

Conversation

@liukewia

@liukewia liukewia commented Aug 7, 2026

Copy link
Copy Markdown

Summary

Improve LightClaw/ACE → Octop backup restore so IM channels, cron jobs, login sessions, and DB schema come back correctly without a full process restart.

  • After restore, rehydrate runtime in-process: reload enabled IM channels from DB (Gateway.reload_channels_from_db) and user cron jobs (CronManager.reload_from_db), while keeping system jobs (e.g. TLS auto-renew) and built-in dashboard/cli channels.
  • On migration restore (preserve_users), capture and restore the live JWT secret with users so outstanding browser sessions stay valid; only seed a new secret when none existed.
  • Re-run DB migrations after restore so older / LightClaw exports (e.g. schema v1 missing later columns like cron_jobs.mcp_servers) are upgraded on the live pool.
  • Parse cron weekday fields with Unix crontab semantics (0/7 = Sunday) so migrated schedules schedule correctly under APScheduler 3.
  • Log original English OctopError messages for 5xx responses (app exception handler + JWT middleware) for diagnosis in ~/.octop/logs.
  • Minor zh locale fix for presetProviders.

Target branch

  • Base is develop (feature / fix — default)
  • Base is main (release/* or hotfix/* only)

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactor / chore
  • Release / hotfix

Test plan

  • make all passes locally
  • Added/updated tests
    • uv run pytest tests/unit/api/test_backup_restore_rehydrate.py tests/unit/backup/test_snapshot.py tests/unit/backup/test_system_archive.py tests/unit/cron/test_cron_manager.py tests/unit/cron/test_cron_trigger.py tests/unit/gateway/test_gateway_runtime_status.py tests/unit/api/test_exception_handlers.py -q
    • Restore a LightClaw/ACE migration archive with channels + cron jobs; confirm channels reconnect and cron schedules fire without restart
    • Confirm login sessions remain valid when preserve_users / migration restore preserves JWT
    • Confirm numeric weekday cron expressions (e.g. 0 / 7 = Sunday) match Unix crontab behavior

Checklist

  • Updated CHANGELOG.md (if user-facing)
  • README / docs updated (if needed)

@liukewia
liukewia force-pushed the feature/migrate-im-channel-cronjob-from-ace branch from c45f4c3 to 3b40655 Compare August 7, 2026 10:19
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.

1 participant