Skip to content

fix(cron): stop retrying failed scheduled occurrences - #3934

Open
uiharuayako wants to merge 2 commits into
openBitFun:mainfrom
uiharuayako:codex/fix-scheduled-job-submit-failures
Open

uiharuayako wants to merge 2 commits into
openBitFun:mainfrom
uiharuayako:codex/fix-scheduled-job-submit-failures

Conversation

@uiharuayako

@uiharuayako uiharuayako commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A daily workspace-targeted job could create a new session every five seconds when submission failed after session creation. Failed submissions now finish that occurrence and retain its error: recurring jobs wait for their next scheduled time, and one-shot jobs stop until explicitly run again.

Fixes #3933.

Type and Areas

Type: bug fix.

Areas: portable Agent Runtime scheduled-job state and Rust core cron service.

Motivation / Impact

  • Consume failed pending triggers instead of retrying the same occurrence.
  • Disable failed one-shot jobs while preserving explicit manual execution and existing missing-session handling.
  • On startup, retire failed retries persisted by older versions while preserving unattempted occurrences and newer manual triggers.

Verification

  • cargo test --locked -p openbitfun-agent-runtime --no-default-features --features agent-runtime --test agent_session_contracts scheduled_job_contracts: 13 passed.

  • cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,scheduled-jobs,git --lib service::cron::service::tests: 18 passed.

  • New failure regressions were reproduced against the pre-fix code. Coverage includes daily scheduling, one-shot/manual execution, missing sessions, legacy-state restoration, and serialization round trips.

  • pnpm run fmt:rs, git diff --check origin/main...HEAD, and node scripts/check-git-object-sizes.mjs --base origin/main --head HEAD passed.

  • pnpm run check:core-boundaries: passed.

  • pnpm run check:core-boundaries:test: 158 passed. The source gate and its self-test require the failed-trigger consumption, next-schedule, and explicit manual-run regressions.

Reviewer Notes

Persisted job/state shapes remain unchanged. Startup reconciliation preserves failure history and the next scheduled time.

AI-assisted with Codex. Testing level: focused unit and contract tests. GUI, live provider, remote workspace, Remote Control, Peer Device, and Detached Dispatch end-to-end scenarios were not exercised.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable. (No copy changes.)

@uiharuayako

uiharuayako commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

这个问题会导致上百条的重试记录,希望能够合入修复

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.

[Bug]: Scheduled jobs create new sessions every 5 seconds when turn submission fails

1 participant