Skip to content

👷 build(database): add topic status and tasks automation mode#13994

Merged
arvinxx merged 3 commits into
mainfrom
feat/tasks-automation-mode
Apr 20, 2026
Merged

👷 build(database): add topic status and tasks automation mode#13994
arvinxx merged 3 commits into
mainfrom
feat/tasks-automation-mode

Conversation

@arvinxx

@arvinxx arvinxx commented Apr 20, 2026

Copy link
Copy Markdown
Member

This release ships a database schema migration that makes two pieces of lifecycle state explicit: how a topic finishes, and how a task is automated. Both already existed implicitly, which made some downstream behaviors ambiguous. This change turns them into first-class columns so the UI, scheduler, and reporting layers can rely on them directly.

Migration overview

Previously, a topic's completion was inferred from surrounding context — there was no dedicated status or timestamp marking when a topic moved out of the active pool. Tasks had a similar ambiguity around automation: heartbeat supervision and cron-style scheduling lived in overlapping fields, so a configured-but-paused schedule looked identical to one that was never set.

This migration makes both states explicit.

topics

  • status (active | completed | archived)
  • completed_at timestamp
  • Indexes on status and (user_id, completed_at) so completion views and archival queries stay cheap

tasks

  • automation_mode (heartbeat | schedule | null) — a single discriminator that makes the two automation kinds mutually exclusive by design and removes the "configured but disabled" ambiguity
  • Index on automation_mode

In practice, the topic list can now distinguish completed and archived records without reinterpreting other fields, and the task scheduler gets a clean switch to route records between heartbeat supervision and cron execution.

Notes for self-hosted users

  • The migration runs automatically during app startup; no manual SQL action is required in standard deployments.
  • All new columns are nullable, so existing rows stay untouched — nothing is backfilled at migration time.
  • As with any schema release, we still recommend a database backup and rollout during a low-traffic window.

The migration owner: @arvinxx — responsible for this database schema change, reach out for any migration-related issues.

@vercel

vercel Bot commented Apr 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lobehub Ready Ready Preview, Comment Apr 20, 2026 8:56am

Request Review

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @arvinxx, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@codecov

codecov Bot commented Apr 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.78%. Comparing base (94b6827) to head (cae218a).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13994      +/-   ##
==========================================
- Coverage   66.78%   66.78%   -0.01%     
==========================================
  Files        2044     2044              
  Lines      174052   174052              
  Branches    17146    21223    +4077     
==========================================
- Hits       116249   116247       -2     
- Misses      57679    57681       +2     
  Partials      124      124              
Flag Coverage Δ
app 59.06% <ø> (-0.01%) ⬇️
database 92.43% <ø> (ø)
packages/agent-runtime 79.72% <ø> (ø)
packages/context-engine 83.22% <ø> (ø)
packages/conversation-flow 92.36% <ø> (ø)
packages/file-loaders 87.02% <ø> (ø)
packages/memory-user-memory 74.74% <ø> (ø)
packages/model-bank 99.86% <ø> (ø)
packages/model-runtime 84.20% <ø> (ø)
packages/prompts 69.24% <ø> (ø)
packages/python-interpreter 92.90% <ø> (ø)
packages/ssrf-safe-fetch 0.00% <ø> (ø)
packages/utils 90.34% <ø> (ø)
packages/web-crawler 88.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store 66.20% <ø> (ø)
Services 52.13% <ø> (ø)
Server 66.77% <ø> (-0.01%) ⬇️
Libs 51.29% <ø> (ø)
Utils 91.12% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@arvinxx arvinxx changed the title 🗃️ feat(tasks): add automation_mode column 🗃️ feat(db): add topic status and tasks automation_mode Apr 20, 2026
@arvinxx arvinxx changed the base branch from release/db-migration-topic-status to main April 20, 2026 07:42
@arvinxx arvinxx force-pushed the feat/tasks-automation-mode branch from a63f5b8 to 4ce2a9c Compare April 20, 2026 07:46
@arvinxx arvinxx force-pushed the feat/tasks-automation-mode branch from 4ce2a9c to c0db57e Compare April 20, 2026 07:54
@arvinxx arvinxx force-pushed the feat/tasks-automation-mode branch from 2225c08 to 02b8b12 Compare April 20, 2026 08:15
@arvinxx arvinxx changed the title 🗃️ feat(db): add topic status and tasks automation_mode 🗃️ feat(db): add topic status and tasks automation mode Apr 20, 2026
@arvinxx arvinxx changed the title 🗃️ feat(db): add topic status and tasks automation mode 👷 build(database): add topic status and tasks automation mode Apr 20, 2026
arvinxx and others added 3 commits April 20, 2026 16:49
- topics: add \`status\` (active/completed/archived) and \`completed_at\`
- tasks: add \`automation_mode\` ('heartbeat' | 'schedule' | null) to make the heartbeat vs schedule distinction explicit
- tasks: drop default on \`heartbeat_interval\` so null cleanly marks "no heartbeat configured" now that automation_mode is the discriminator

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Aligns with canary (#13979): vi.resetModules + dynamic import re-parses
antd + @lobehub/ui on every test, which can blow past the default 5s
timeout on cold CI runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@arvinxx arvinxx merged commit 3bcd581 into main Apr 20, 2026
33 checks passed
@arvinxx arvinxx deleted the feat/tasks-automation-mode branch April 20, 2026 09:34
mrsimpson added a commit to mrsimpson/lobehub that referenced this pull request May 8, 2026
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.

3 participants