Skip to content

feat: add conversation scheduled runs#3576

Closed
Huixin615 wants to merge 1 commit into
bytedance:mainfrom
Huixin615:feature/conversation-scheduled-runs
Closed

feat: add conversation scheduled runs#3576
Huixin615 wants to merge 1 commit into
bytedance:mainfrom
Huixin615:feature/conversation-scheduled-runs

Conversation

@Huixin615

Copy link
Copy Markdown
Contributor

Refs #3525

Why

This PR adds the first phase of conversation-created scheduled runs.

The issue asks DeerFlow to support scheduled tasks from a conversation. Without this, users cannot ask the agent to run a reminder or follow-up task at a future time, and browser users need to manually refresh to see scheduled results.

This implementation focuses on one-time scheduled runs first, keeping recurring schedules out of scope for a follow-up discussion.

What changed

  • Added a built-in schedule_task tool for creating one-time scheduled tasks from the current conversation.
  • Added persistent scheduled task storage backed by the existing sqlite/postgres persistence layer.
  • Added a Gateway-local scheduler service that polls due tasks, claims them with a DB lease, and executes them through the normal DeerFlow run path.
  • Added thread-scoped SSE events so the web chat can refresh scheduled run results without requiring a browser refresh.
  • Added scheduled task management APIs for listing, reading, and cancelling scheduled tasks.
  • Added support for relative delays via delay_seconds, so requests like "remind me in 3 minutes" do not require the model to know the current clock time.
  • Hid internal scheduled-run trigger messages from the chat UI to avoid exposing scheduler prompts to users.
  • Fixed /workspace/chats/new routing so users can reliably open a new chat route.
  • Added scheduler configuration, documentation, and regression tests.

The scheduler is disabled by default:

scheduler:
  enabled: false
It requires database.backend to be sqlite or postgres because scheduled tasks need durable persistence.
## Surface area

Surface area

  • Frontend UI — page / component / setting / interaction under frontend/
  • Backend API — endpoint / SSE event / request-response shape under backend/app
  • Agents / LangGraph — agent node, graph wiring, langgraph.json, or prompt change
  • Sandboxdocker/ or sandboxed execution
  • Skills — change under skills/
  • Dependencies — new/upgraded entry in backend/pyproject.toml or frontend/package.json (say what it buys us)
  • Default behavior change — changes existing behavior without the user opting in (default model, default setting, data shape)
  • Docs / tests / CI only — no runtime behavior change

Screenshots / Recording

image image

Bug fix verification

N/A - this is primarily a feature PR.

Validation

Ran:

cd backend && uv run ruff check app packages/harness/deerflow tests/test_scheduled_tasks.py
cd backend && uv run ruff format --check app packages/harness/deerflow tests/test_scheduled_tasks.py
cd backend && uv run pytest
cd frontend && pnpm check
git diff --cached --check

Results:
Backend full test suite: 4392 passed, 16 skipped
Backend ruff check: passed
Backend ruff format check: passed
Frontend lint/typecheck: passed
Cached diff whitespace check: passed

@github-actions github-actions Bot added area:backend Gateway / runtime / core backend under backend/ area:docs Documentation and Markdown only area:frontend Next.js frontend under frontend/ needs-validation Touches front/back contract surface; needs real-path validation risk:high High risk: backend API, agents, sandbox, auth, deps, CI size/XL PR changes 700+ lines labels Jun 14, 2026
@WillemJiang

Copy link
Copy Markdown
Collaborator

It will be addressed in #1092

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend Gateway / runtime / core backend under backend/ area:docs Documentation and Markdown only area:frontend Next.js frontend under frontend/ needs-validation Touches front/back contract surface; needs real-path validation risk:high High risk: backend API, agents, sandbox, auth, deps, CI size/XL PR changes 700+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants