Skip to content

[Background Jobs] Add persistent scheduled research tasks and desktop notifications #38

Open

Description

@helsome

Background

长时间 Deep Research、Watchlist 巡检和定期研究摘要不应该要求用户一直停留在聊天窗口里等待。Folio 需要一个持久化 background job 层,让任务可以在应用后台运行、失败可诊断、完成后通知用户,并能在重启后恢复正确状态。

这项能力建立在 #18 的 durable run state 上,但关注 任务调度、后台执行和用户通知,而不是单次 run 的 checkpoint。

Related: #17 #18 #27 #32 #37

Requirements

Persistent job model

至少包含:

  • job id / type;
  • enabled state;
  • schedule / trigger config;
  • task input / target watchlist or portfolio;
  • created_at / next_run_at / last_run_at;
  • last result/run id;
  • running / succeeded / failed / cancelled / missed 状态;
  • retry policy;
  • notification policy。

Initial job types

首版至少支持:

  • 长时间 Research 在窗口切换/最小化后继续运行;
  • scheduled watchlist/company research digest;
  • scheduled filings/announcement check;
  • 对已有 Deep Research completion/failure 进行通知。

Scheduler semantics

Notifications

至少支持应用内 notification center + 桌面系统通知(Electron 支持范围内):

  • research completed;
  • research failed / needs attention;
  • scheduled digest ready;
  • new filing/announcement found(对应任务启用时)。

点击 notification 应能进入对应 report/run/job。

Privacy / control

  • 用户可以暂停/删除 schedule;
  • notification 不应在锁屏/系统通知中默认暴露敏感 portfolio 全文;
  • 后台任务不获得比前台任务更高的 tool 权限。

Acceptance Criteria

  • 至少有一个可持久化 recurring scheduled job,并能 enable/disable/delete。
  • 最小化/切换页面不会终止正在运行的 Research。
  • 应用重启后 schedule 与 last-run state 能恢复。
  • 同一 job 不会因 scheduler race 重复执行。
  • missed run 有明确 reconciliation 策略。
  • completion/failure 能产生可点击通知并打开对应 run/report。
  • 后台 run 保留正常 evidence、manifest 和 Tool Activity。
  • PR 必须真实创建一个 watchlist/filing 定时任务,执行实际数据检索/模型任务并触发通知;另测试一次应用重启后的 schedule 恢复和一次任务失败通知。

Non-goals

  • 首版不要求在操作系统彻底结束 Folio 进程后仍由独立系统 daemon 永久运行;至少要求 schedule 持久化并在应用恢复时正确 reconcile。
  • 不实现自动交易。

Activity

  1. Cordis798 commented on Sep 11, 2026

    @Cordis798

    claim

  2. github-actions commented on Sep 11, 2026

    @github-actions

    @Cordis798 已认领该 Issue,并已自动设为 Assignee。提交 PR 时请在描述中写 Closes #38。

  3. added
    claimed
    on Sep 11, 2026
  4. github-actions commented on Oct 19, 2026

    @github-actions

    @Cordis798 这个 Issue 已认领超过 7 天,目前没有发现关联的 open PR,也没有看到最近 7 天的进度更新。

    如果仍在推进,请在 3 天内 留一条简短进度说明(包括正在等待的前置依赖也可以);如果已经有 PR,请贴出链接。若 3 天内没有回应,认领会自动释放,方便其他贡献者接手。

  5. removed
    claimed
    on Oct 23, 2026
  6. github-actions commented on Oct 23, 2026

    @github-actions

    @Cordis798 在提醒后 3 天内没有进度回应,且仍未发现关联的 open PR;本次认领已自动释放。Issue 保持开放,可以重新认领。

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions