Skip to content

fix(cron): clear scheduled jobs when sessions change - #738

Open
outlier27-cell wants to merge 1 commit into
openpi-dev:mainfrom
outlier27-cell:fix/issue-736-cron-session-state
Open

outlier27-cell wants to merge 1 commit into
openpi-dev:mainfrom
outlier27-cell:fix/issue-736-cron-session-state

Conversation

@outlier27-cell

Copy link
Copy Markdown
Contributor

Problem

/cron documents scheduled prompts as session-scoped, but a second Pi session_start retained the preceding session's in-memory jobs. A due old-session prompt could therefore be delivered after /new or /resume.

Value

Scheduled prompts now remain owned by the session where the user created them, preventing cross-session follow-ups.

Approach

  • Reset cron-owned jobs, the ID sequence, and the polling timer before accepting a new session context.
  • Add a lifecycle regression covering a second session_start, absence of the old job, and normal scheduling in the new session.

Validation

  • node --test --experimental-strip-types tests/extensions/cron/index.test.ts tests/extensions/cron/schedule.test.ts (23 passed)
  • bun run check (passed: config/docs/disciplines, Web build, format, lint, and typecheck)
  • bun run test was started, but unrelated Git/process, renderer, and workflow tests failed under the Windows parallel runner and the run later stalled. The cron suite itself passed in that run. Exact-head GitHub CI is required before merge.

Impact

No persistent state, provider behavior, or model-facing surface changes. Existing jobs are intentionally cleared whenever Pi begins a new session lifecycle.

Closes #736

@outlier27-cell

Copy link
Copy Markdown
Contributor Author

@tt-a1i 请审核此 PR。#736 的跨 Session 定时任务泄漏已在 c686292 修复;exact-head GitHub CI(Node、Windows、UI、Web E2E)均通过。当前仅等待审核。

This branch has not been deployed

No deployments
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.

fix(cron): clear scheduled prompts when a new Pi session starts

1 participant