Skip to content

Recover failed agent startups and honor pause and shutdown (Codex) - #40

Merged
guo-yu merged 2 commits into
mainfrom
codex/preserve-agent-start-delivery
Nov 24, 2026
Merged

guo-yu merged 2 commits into
mainfrom
codex/preserve-agent-start-delivery

Conversation

@guo-yu

@guo-yu guo-yu commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex reviewed the startup and shutdown paths used by the agent supervisor in this 180-day repository review.

A transient error after receiving a message could leave an on-demand agent marked running with its message already marked delivered. A detached steer or backlog trigger could reject outside the supervisor's error handler. Slow startup also let a child launch after shutdown or while the agent was paused. The continuous loop accumulated an abort listener on every completed idle wait.

This change restores the original SQLite message IDs when preparation fails before handoff, makes background trigger failures observable, and checks lifecycle state before creating the child. The loop removes its cancellation listener on both timeout and abort. Older custom transports that lack durable redelivery keep the startup batch in memory for the next trigger.

Five new regression checks failed on the original main commit. All 52 agent lifecycle tests passed on the final fix, using the real SQLite-backed mailbox and a substitute for the child process. Secondary validation injected an SQLite delivery-flag write failure, an asynchronous redelivery error, and a missing-session cold-start failure. A held batch remains retryable even while the database is temporarily unwritable. Issue #21 and PR #22 track a separate resume behavior for runnable work without messages.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T10:32:44.673850Z a84ccca 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.

@guo-yu
guo-yu merged commit fb9e1fc into main Nov 24, 2026
1 check passed
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.

2 participants