Skip to content

fix(codex): check wake-up support before unattended work - #536

Open
oliver-mee wants to merge 10 commits into
michael-denyer:mainfrom
oliver-mee:codex-wakeups
Open

oliver-mee wants to merge 10 commits into
michael-denyer:mainfrom
oliver-mee:codex-wakeups

Conversation

@oliver-mee

@oliver-mee oliver-mee commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Autopilot-full step 6 and Shipping step 5 arm a /loop wake-up, and Codex has no /loop (#535). When the session cannot wake itself after the turn ends, nothing watches a queued merge or an unattended program.

  • Shipping gains a rule beside its GraphQL stop. When the session cannot wake itself after the turn ends, request no merge that can outlast the turn, queued or automatic, and start no unattended work. A PR that would need such a merge stops at merge-ready, and the agent reports the limit. A merge already pending on entry is cancelled and read back in step 1, and reported. A guarded merge that completes within the turn still lands.
  • Autopilot-full step 6, where the audit tick is armed, gets the same check. With no tick to arm, start no unattended work, and tell the operator before the first owner starts.
  • The Codex loop row names the wake-up, a scheduled task in this chat from the ChatGPT desktop app. It counts only when the task's default sandbox lets the step's commands reach the network. The row says the session on the Codex CLI, the IDE extension and the web cannot wake itself after the turn ends, gives the reasons, and says to re-run the step only while the turn is active.

Fixes #535

Changes on top of @oliver-mee's commits

The three commits from @oliver-mee stay as they were. Three merges of main and three commits sit on top of them. The branch is up to date with main at 14b4b8f.

  • 52dce4e follows the 2026-11-25 review comment, which replaced the 2026-11-24 review's advice to keep a Codex sentence in step 1.
    • Removed the two "On Codex" sentences from step 1 of both playbooks, and added the runtime-neutral rules.
    • Deleted the ### Wake-ups on Codex section and put the Codex answer in the loop row.
    • Reworded the two tools/forks.json why additions to match.
    • Added changes/codex-wake-up-check.md with author: oliver-mee.
  • eb0e033 follows one independent review of the diff.
    • The row named /goal, which the sync denylist rejects, and CI's test job failed on it. It now says "a Codex goal (create_goal)".
    • "Request no merge that may queue" left an armed auto-merge unwatched. The Shipping rule now bars any merge that can outlast the turn, queued or automatic. This widens the review's wording on purpose.
    • The row named the web as a wake-up source, but a scheduled task on the web keeps no local folder or worktree. It now names only the desktop app, with the condition that the computer is on and the app is running.
    • The row gave a CLI reader no fallback. It now says to re-run the step only while the turn is active and to report the last state seen.
  • 206abbd follows a second independent review, of eb0e033.
    • A scheduled task runs unattended under the default sandbox, which may block the network calls a Shipping step makes through gh. The row now counts the task as a wake-up only when that sandbox lets the step's commands reach the network.
    • The row now says the web gives no wake-up either, so a reader there gets an answer. It also says the IDE extension doesn't provide scheduled tasks, which is what the docs say, in place of "creates".
    • The Shipping rule covered only merges the session requests. A merge already pending on entry now gets cancelled and read back in step 1 and reported, since it outlasts the turn the same way. The 2026-11-25 review covered only requests, so this goes past it.
    • The tools/forks.json why and the fragment said "such a PR" with nothing for it to point at. They now name a PR that would need such a merge.

How the Codex row was checked

I probed Codex CLI 0.173.0-alpha.4.1, the copy bundled in ChatGPT.app, against a local stub provider, from a throwaway home with no login. The stub recorded each request and answered 400, so no signed-in model turn ran. In codex exec and in the TUI, with gpt-6.1-sol, the CLI offered exec_command, apply_patch, the three goal tools, clock.sleep, and the sub-agent tools. The TUI added thread and worktree tools. None of them schedules a wake-up after the turn ends. clock.sleep takes up to 43,200,000 ms and ends early when new input arrives for the active turn. With a model the CLI didn't know, it sent plain JSON tools and no clock.sleep.

The scheduled-task facts come from OpenAI's scheduled tasks page. It says the Codex CLI and IDE extension don't provide the scheduled-task interface, that a task can be created from a ChatGPT or Codex chat, and that a task in a chat keeps the chat's context. It also says a task runs unattended with the default sandbox settings, that workspace-write fails network calls, and that a task on the web keeps no local folder or worktree between runs. The goal tools' schemas take an objective, a token budget and a status, and no time.

Test run

At head 206abbd, on macOS with Bun 1.4.4 and frozen installs in the root, plugins/, and the poteto-mode scripts:

bun tools/generate.mjs --check: ok, 87 generated files current
bun tools/release.mjs check <merge base 14b4b8fd>: ok
bun test tests/: 2951 pass, 300 skip, 0 fail (3251 tests, 79 files)
markdownlint-cli2 0.18.1 and lychee --offline --include-fragments on the changed files: 0 errors
pinned sync dry-run at ca782ed8: 56 forked files, the same as main at 14b4b8fd; shipping.md 16 to 18 changed lines, autopilot-full.md 18 on both
CI on 206abbd: all five workflows succeeded

The first pushed head, 20040c8, failed CI's test job on the /goal denylist hit. eb0e033 fixed it.

Rough edges

  • No signed-in model turn ran in the CLI or the app. The review asked for a check against a real Codex CLI session. The probe recorded the tools the CLI offers, not what a model does with them.
  • The app's scheduled task, its sandbox limit, and the IDE extension's lack of one come from the docs only. I did not create a task or run the IDE extension, and I don't know the name of the tool behind a task, so the row names the feature, not a tool.
  • Two CLI paths were not probed. The TUI's send_message_to_thread sends a prompt to another task, and a sub-agent's final answer returns to the root. If either can start a turn on an idle root, the CLI can wake itself and the row is wrong in the cautious direction.
  • A Codex goal starts a continuation turn by itself after a turn finishes while the thread is idle. The row counts that as no wake-up, since nothing sets a time or waits on an event.
  • The probed CLI is an alpha build. I did not install the npm release.
  • The Autopilot check sits in step 6, where the review placed it, and says "before the first owner starts", which happens in step 2. An agent working the list in order could start owners first.
  • Shipping's changed-line count against upstream goes from 16 to 18 because of the new paragraph. Autopilot-full stays at 18, and the sync dry-run reports 56 forked files, the same as main at 14b4b8f.
  • fix(codex): translate the remaining loop recipes #550 carries this branch and extends the same loop row. Land this PR first.
  • The review's two findings outside this diff are filed. Codex: the overnight recipe and Autonomous run start unattended work with no wake-up check #658 covers the overnight recipe and Autonomous run, which have no wake-up check. Runtime loop rows that leave "can the session wake itself" to judgement #659 covers other runtimes' loop rows that leave the question to judgement.
  • A third review, of 206abbd, found no high or medium issue. Its low-severity points stay open for the maintainer:
    • The sandbox test names only the network, while the docs say workspace-write also fails writes outside the workspace. The row doesn't say how to tell the default sandbox, or to count one you can't read as no wake-up.
    • The docs say a web task returns to the chat with its context. The row's "no wake-up on the web" holds only for a step that needs a local folder or worktree. The error is on the safe side.
    • Step 1's own cancel sentence still names only merges that lack step 4's gates, so an agent re-entering step 1 from step 6 may keep a gated pending merge.
    • The cancel applies on every runtime without a wake-up the agent can arm, not only on Codex. On a branch that requires the merge queue, a cancelled entry loses its place until the user re-queues it.
    • In the tools/forks.json why, "would need one" can read as pointing at "one already pending".
    • No tests/skill-rules.test.mjs pin covers the new Shipping or Autopilot rule. Main pins nothing in shipping.md today.

Developed with AI agents, with a human in the loop. Model: GPT-6 (Codex).

@oliver-mee
oliver-mee marked this pull request as ready for review November 24, 2026 13:24
@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-24T13:29:05.323613Z 4686841 Draft marked ready
ℹ️ 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.

@michael-denyer michael-denyer left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for this. The gap in #535 is real. autopilot-full step 6 and shipping step 5 assume Claude Code's /loop, and the old Codex loop row didn't say what to do when Codex can't wake itself. I'm requesting changes because of where the fix lives, not what it says.

1. Runtime branches in shared playbooks

No playbook on main branches on a runtime. This finds nothing:

git grep -n -i -E "\bon (codex|pi|github copilot|copilot|muse|minimax|antigravity|omp|kimi|opencode|claude code)\b" origin/main -- plugins/pstack/skills/poteto-mode/playbooks

Playbooks are written in Claude Code terms, and each runtime translates them in its references/<runtime>-tools.md. copilot-tools.md:81 handles the same /loop audit tick that way.

This PR adds "On Codex / On Claude Code" pairs to five playbooks. bun tools/sync.mjs pstack <pinned sha> --dry-run shows forked files going from 55 to 57, because autonomous-run.md and visual-parity.md become forks. Your rewritten loop row in codex-tools.md already reaches every site that names loop, including babysit.

What I'd keep and drop:

  • Keep the loop row in codex-tools.md. Fold the four bullets of codex-wakeups.md into it, or into a short section under the table, so a reader takes one hop instead of two.
  • Keep the Codex gate sentence in autopilot-full step 1 and shipping step 1. You're right that the check has to run before owners start or a merge can queue, which is earlier than where those playbooks name loop. Both files are already forks, so this adds no new fork.
  • Revert the rest. That means the edits to autonomous-run.md, bug-fix.md, visual-parity.md, autopilot-full.md step 6 and shipping.md step 5, plus the two new forks.json entries.

2. Claude Code text changed

Three hunks replace text instead of adding beside it, which changes behaviour outside Codex:

  • visual-parity.md step 4. "/loop per component until the diff is zero" becomes "Repeat per component", so Claude Code loses /loop.
  • autopilot-full.md step 6. "which schedules its own wake-up rather than blocking on a sleep" is gone. "because long runs drift and agents stall silently" now attaches to the Claude-only sentence.
  • autonomous-run.md step 2. The parenthetical "(a built-in, not a pstack skill)" is dropped.

Reverting those files as described above clears all three.

3. Overlap with #538

The two PRs conflict on autopilot-full.md step 1 and on its forks.json why string. Whichever lands second needs a rebase.

@michael-denyer

Copy link
Copy Markdown
Owner

Thanks @oliver-mee for finding and fixing this. The gap from #535 is real. Autopilot and Shipping can start unattended work, or request a merge that may queue, before anything checks that the session can wake itself up after the turn ends. I reviewed head 6ebf232. Points 1 and 2 block merging. Points 3 and 4 are the rest of the same change, so please fold them in too. Point 5 is about merge order.

1. The Codex check is a runtime branch inside upstream's runtime-neutral playbooks. This blocks merging. The PR adds "On Codex, apply the wake-up preflight ..." to step 1 of playbooks/autopilot-full.md (line 9) and step 1 of playbooks/shipping.md (line 9). On main, no playbook line names a runtime: git grep -E "On Codex|In Codex|On Pi,|On Copilot|On Muse|On OMP" origin/main -- 'plugins/pstack/skills/*/playbooks/*' returns nothing. Both sentences also land inside step-1 text that upstream owns at the pinned SHA. SKILL.md line 12 routes each runtime's translation through its own mapping file. The gap isn't Codex-only either. copilot-tools.md line 81 tells Copilot CLI to re-run the step each turn. omp-tools.md line 23 hands the user a /loop command. dsh-tools.md line 27 says there is no equivalent. opencode-tools.md line 10 calls the mechanism runtime-specific. As written, every one of those runtimes either adds its own "On X" clause to the same sentences or keeps the bug.

Shipping already has the pattern to copy. The GraphQL stop at shipping.md line 7 names a capability, uses a runtime only as an example, and sits beside upstream's steps. Please drop both "On Codex" sentences. Then add one runtime-neutral rule beside that GraphQL paragraph, and one at Autopilot step 6 (autopilot-full.md line 28), where the tick is armed: when the session cannot wake itself after the turn ends, request no merge that may queue and start no unattended work. Stop at merge-ready and report the limit. Reword the two tools/forks.json why additions to match.

2. The Codex mapping should be one loop row and no new section. This blocks merging. references/codex-tools.md gets a ### Wake-ups on Codex section. Bullet 3 repeats Shipping step 5 (shipping.md line 13) in different words: the same bottom-to-top list on every watcher restart, and ship-pr inspect at each wake-up against the approved base OID. Bullet 4 repeats Autopilot's stop rule. shipping.md has had 12 commits, so a second copy will drift from the first. The section also never names a Codex tool. It talks about "a Codex Goal" and "an authorized same-chat scheduled task or equivalent wake-up". The Antigravity (schedule), MiniMax (self_reminder), Kimi (CronCreate) and Pi (/loop) mappings each name the tool. "Or equivalent" turns a yes/no availability check into a judgement call. Please delete the section. Put the Codex answer in the loop row of the driver table: the mechanism that arms a wake-up after the turn ends, or a plain statement that the CLI has none. Once point 1 lands, the playbook rule covers the "none" case. The PR body says no live scheduled run was exercised, so please confirm the row against a real Codex CLI session.

3. The check sits at step 1, away from the step that arms the wake-up. In Shipping, step 1 is forge resolution and verification. The merge request is step 4 and the /loop watcher is step 5, so a reader at step 4 never sees the check. In Autopilot, the new section requires a wake-up already "armed" before owners start, while step 6 still arms the hourly tick "on the operator's go". That leaves two arming points, and the text doesn't say whether they are the same wake-up. Point 1's placement fixes this as long as the wording stays consistent: "cannot wake itself" at the check, "arm" at the arming step, so one sentence creates the wake-up.

4. One wake-up home shared with #550. #550 adds a ## Repeating work on Codex section to the same codex-tools.md, with nearly the same "confirm an authorized wake-up" rule. If both PRs land as written, the file has the rule twice, with two different strengths. The split I'm asking for on both PRs: this PR carries the wake-up check (the playbook rule from point 1 and the Codex loop row from point 2). #550 adds only its two /loop translations to that same row and drops its own confirm sentence. Neither PR adds a new wake-up section.

5. Merge order. #551 also edited codex-tools.md and has merged, so this branch needs to merge main. Whichever of this PR and #550 lands second then merges main again and extends the loop row the first one edited.

bun tools/generate.mjs --check passes at this head. The pinned upstream sync dry-run reports 18 changed lines for autopilot-full.md and 16 for shipping.md. Both edits replace existing lines one for one, so those counts cannot rise even though the text in those lines changed.

@michael-denyer

Copy link
Copy Markdown
Owner

Thanks @oliver-mee for this fix. I'm making the requested edits on this branch now, so you don't need to. The edits are these:

  • Drop the two "On Codex" sentences.
  • Add the runtime-neutral wake-up rule beside Shipping's GraphQL paragraph and at Autopilot step 6.
  • Put the Codex answer in the loop row and delete the new section.
  • Merge main.

Your commits stay as they are, and mine go on top. The PR body will list what I changed.

…x loop row

Drop the two "On Codex" step-1 sentences and the Wake-ups on Codex section, per the 2026-11-25 review. Shipping gains a rule beside its GraphQL stop, and Autopilot-full one where the audit tick is armed: when the session cannot wake itself after the turn ends, request no merge that may queue, start no unattended work, and report the limit. The Codex loop row names the wake-up (a scheduled task in the chat, from the ChatGPT desktop app or web) and says the CLI and IDE extension have none. Adds the changelog fragment crediting oliver-mee.
michael-denyer added a commit to oliver-mee/pstack-claude that referenced this pull request Dec 4, 2026
michael-denyer added a commit to oliver-mee/pstack-claude that referenced this pull request Dec 4, 2026
Per the 2026-11-25 review: delete the Repeating work on Codex section and its wake-up sentence, since michael-denyer#536 carries the wake-up check, and add the in-turn repeat and the recipe rule to the loop row by what the reader is doing. Revert the poteto-help pointer and its forks.json why, because poteto-help already sends recipe adaptation to the Codex mapping. Adds the changelog fragment crediting oliver-mee.
michael-denyer added a commit to oliver-mee/pstack-claude that referenced this pull request Dec 4, 2026
Say "a Codex goal" instead of the /goal token, which the sync denylist rejects and which failed the CI test job. Bar any merge that can outlast the turn, queued or automatic, so an armed auto-merge is not left unwatched, while a guarded merge that completes in the turn still lands. Name only the desktop app as the wake-up source, since a scheduled task on the web keeps no local folder or worktree, and give the CLI its fallback: re-run only while the turn is active and report the last state seen.
michael-denyer added a commit to oliver-mee/pstack-claude that referenced this pull request Dec 4, 2026
…ecipes

# Conflicts:
#	plugins/pstack/skills/poteto-mode/references/codex-tools.md
michael-denyer added a commit to oliver-mee/pstack-claude that referenced this pull request Dec 4, 2026
…un the step

A second review of eb0e033 found that a desktop scheduled task runs unattended under the default sandbox, which may block the network calls a Shipping step needs. The loop row now names that condition, says the web gives no wake-up either, and says the IDE extension doesn't provide scheduled tasks rather than that it can't create them.

Shipping's rule covered only merges the session requests. A merge already pending on entry outlasts the turn the same way, so step 1 now cancels and reads it back when the session cannot wake itself.

The forks.json why and the fragment said "such a PR" with nothing for it to point at. They now name a PR that would need such a merge.
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.

Codex unattended playbooks require Claude Code's /loop

2 participants