Skip to content

fix: preserve native Codex recurrence during loop re-enable - #84

Merged
roodboi merged 1 commit into
mainfrom
codex/native-scheduler-recurrence
Sep 14, 2026
Merged

roodboi merged 1 commit into
mainfrom
codex/native-scheduler-recurrence

Conversation

@roodboi

@roodboi roodboi commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Codex stores native task recurrence as FREQ=.... Re-enabling a loop after a native task update rejected that value because fclt validates canonical recurrence as RRULE:FREQ=....

Normalize the native value at the adapter boundary and preserve the task's stored recurrence unless the caller explicitly changes cadence. Project and global regression fixtures verify re-enable, disable, ownership, and preservation of authored task fields.

Validation: lint, typecheck, 73 focused tests, and compiled binary verification pass. The actual paused task now passes enable dry-run and remains byte-for-byte unchanged. No schedule activation or state-directory relocation.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-14T16:06:00.423901Z 839e6ad PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@roodboi
roodboi merged commit 37e7e20 into main Sep 14, 2026
5 checks passed
@roodboi
roodboi deleted the codex/native-scheduler-recurrence branch September 14, 2026 16:05

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 839e6ad7e7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/evolution-loop.ts
name,
status: "ACTIVE",
rrule: config.rrule,
rrule: args.rrule ? config.rrule : undefined,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore recurrence when the task has none

When an owned automation has lost its rrule field or stores an empty string, automationStatus still considers it registered because ownership identity only covers id, created_at, and cwds. Passing undefined here then activates the task without restoring a cadence, while enable persists a valid recurrence in its config and reports success, so the supposedly enabled loop may never be scheduled. Preserve the stored recurrence only when it is nonempty; otherwise pass the configured recurrence or reject the task.

Useful? React with 👍 / 👎.

Comment thread src/evolution-loop.ts
Comment on lines +675 to +677
existingAutomation.rrule.startsWith("RRULE:")
? existingAutomation.rrule
: `RRULE:${existingAutomation.rrule}`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Normalize before checking the recurrence prefix

For a stored canonical recurrence whose prefix differs only by case or surrounding whitespace, such as rrule:freq=weekly, the previous direct normalizeRrule call accepted it because that helper trims and uppercases first. This case-sensitive precheck now prepends another prefix, producing RRULE:RRULE:FREQ=... and making re-enable fail. Apply the same trim/case normalization before deciding whether the native value needs a prefix.

Useful? React with 👍 / 👎.

github-actions Bot pushed a commit that referenced this pull request Sep 14, 2026
## [2.31.1](v2.31.0...v2.31.1) (2026-09-14)

### Bug Fixes

* preserve native Codex recurrence during loop re-enable ([#84](#84)) ([37e7e20](37e7e20))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.31.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant