Skip to content

fix: preserve scheduler ownership and flush loop output - #83

Merged
roodboi merged 9 commits into
mainfrom
codex/scheduler-ownership-recovery
Sep 14, 2026
Merged

roodboi merged 9 commits into
mainfrom
codex/scheduler-ownership-recovery

Conversation

@roodboi

@roodboi roodboi commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Piped loop output below 64 KB could still be truncated because the output helper returned after console logging. Await stdout writes at every response size.

Native automation updates can drop fclt’s custom ownership marker. Subsequent loop management then rejects the existing schedule, and re-enabling could overwrite native edits. Store an identity-bound ownership receipt in existing machine-local state, preserve authored automation settings when re-enabling, and provide explicit repair for already-affected configured loops without activating them.

Related: HACK-1044. Builds on merged review-preflight recovery #82.

Validation:

  • 74 integrated evolution-loop, preflight, and path tests passed.
  • CLI repair test passed, preserving the complete paused automation.
  • 41 CLI, locator, and pipe-output tests passed, including empty, small, medium, and large responses.
  • The existing project automation was repaired, updated through the official Codex automation API, and remained registered and paused. Settings other than the intended prompt update and update timestamp matched exactly; piped status JSON parsed successfully from the compiled candidate.
  • Marker-stripping updates preserve prompt, model, cadence, target, notification policy, working directories, creation time, and memory in global and project fixtures.
  • Moved/replaced tasks and explicit different owners are rejected. A status edit matching authored multiline prompt content is refused without writing.
  • Typecheck, lint, diff checks, compiled binary verification, and package dry-run passed. Cross-platform CI is required before merge.

Repair records a runtime ownership receipt only. It does not relocate state, enable a paused schedule, apply capability changes, or infer ownership from the display name alone.

@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-14T15:36:07.380203Z 6308bf6 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

fclt/src/evolution-loop.ts

Lines 676 to 677 in 6308bf6

const scaffold = existingAutomation.exists
? { path: join(args.homeDir, ".codex", "automations", name) }

P2 Badge Commit loop configuration only after scheduler activation

When an existing owned automation is paused but uses valid noncanonical TOML—such as status = 'PAUSED' or an inline status comment—this shortcut preserves the file, then the configuration is persisted as enabled before setCodexAutomationStatus rejects its strict line layout. The enable command therefore fails while leaving an incremented, enabled loop configuration and a still-paused scheduler; validate/update the scheduler before committing the configuration or roll the configuration back on failure.


await mkdir(path, { recursive: true });
const probe = await mkdtemp(join(path, ".fclt-preflight-"));
await rmdir(probe);

P2 Badge Probe existing append-only files before reporting ready

When an existing journal, writeback queue, or loop audit file is read-only or has a file-specific denying ACL while its parent remains writable, creating a temporary directory succeeds and preflight reports ready, but the subsequent loop fails on appendFile; an audit failure can occur after reports, state, and other mutations have already been committed. Preflight should test the actual append sinks as well as directory creation so ready reliably gates the scheduled run.

ℹ️ 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".

@roodboi roodboi changed the title fix: preserve evolution scheduler ownership across native edits fix: preserve scheduler ownership and flush loop output Sep 14, 2026
@roodboi
roodboi merged commit 545c1af into main Sep 14, 2026
5 checks passed
@roodboi
roodboi deleted the codex/scheduler-ownership-recovery branch September 14, 2026 15:40
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.30.6 🎉

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