Skip to content

refactor!: stop waiting on GitHub and keep workers in a 5-minute cache - #276

Closed
kixelated wants to merge 5 commits into
mainfrom
codex/local-work-handoff
Closed

kixelated wants to merge 5 commits into
mainfrom
codex/local-work-handoff

Conversation

@kixelated

@kixelated kixelated commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Coding agents stayed alive waiting on GitHub checks and reviews, and each wake reread a large context. An audit of a week of Claude transcripts on three hosts traced about 65% of subagents' 5–60 minute idle gaps to CI/PR waits and polling, and 14% to tests and builds.

This PR stops agents waiting on GitHub and splits the work so background workers fit a 5-minute prompt cache while the foreground coordinator keeps a 1-hour one.

Behavior

  • No GitHub waits. quest wait, the runner's wait tool, and the webhook wake transport are removed. One-shot quest status, queue submission, and landing reconciliation stay. Nothing local watches a PR after publication; a later invocation reads its state and acts. Runner tools refuse further work after a successful delivery and allow a retry after a failed one.
  • Workers do one burst. Every worker tool call returns within 4 minutes. A worker commits, reports, and terminates, pushing only to a draft. Open decisions go under ## Decisions needed in its PR. The coordinator asks the user, records the answers in the PR, and starts a fresh agent instead of resuming the one that asked.
  • The coordinator runs the long waits. Full checks, quest review rounds, and gated commands run in the coordinator, in the worker's checkout, with each wait under an hour. It gives each round's findings to a fresh /quest-iterate worker, which works under the coordinator's hold, and it pushes to a ready PR only after checks and review pass. A foreground session working alone does both.
  • /quest-complete, /quest-spawn, and /quest-afk stay long-running coordinators. That restores the interactive prompt after /quest-review, PR-list refreshes, and automatic /quest-plan of suggested follow-ups, which an earlier commit here had removed on the assumption that coordinators would exit.

Follow-up quests

  • Gate tickets: quest gate returns within 4 minutes, either admitted with a token or queued with a ticket, so waiting for admission stops outlasting a worker's cache.
  • Fix ejected landings: an ejection webhook starts a fresh kix merge job that fixes the PR and lands it again, or labels it for the maintainer.
  • moq and moq.pro each plan just check and just test under 5 minutes per diff, in their own PRs.

Decisions needed

Re-read on 2026-11-01 against main at a27cacd, 57 commits past this PR's base. The PR now conflicts with main in README.md and in the complete, merge, review, and spawn skills. The code removals still merge cleanly.

What main already covers

What conflicts

  • Removing quest wait, the runner's wait tool, and the webhook wake. The guide's Workspace section on main still says "Wait on a PR's CI or reviews with quest wait ... Bound each wait under an hour". On 2026-11-01 the maintainer also dropped their personal "never wait or poll for GitHub CI" rule. Waiting after publication is still discouraged ("report the PR and terminate"), but waiting is no longer banned outright. Main still uses all three removed pieces.
  • The worker/coordinator split, where workers never run /quest-review, reverses main's current flow. On main, each started agent runs /quest-review itself, and /quest-complete runs /quest-iterate and /quest-review in sub-agents that report when done.

What still applies

  • The 5-minute worker cache idea: one burst per worker, tool calls under 4 minutes, and the coordinator running the long checks and review rounds. The gate tickets quest depends on it. Neither is on main. The open P2 finding from the 2026-10-29 review is still unfixed: a finished worker's draft stays held by its starter, so the coordinator's quest ready is refused.
  1. What to do with this PR?
    • Close as superseded (recommended). Main already ships the "skills don't wait on GitHub" half. The quest wait removal contradicts the current guide and the maintainer's latest stance, and the eject fixer is replaced. Comment with this analysis when closing.
    • Rework to fit: drop the quest wait, runner wait, and webhook-wake removals and the eject-fix quest, then rebuild the worker/coordinator split on main's current skills and fix the P2 handoff. That amounts to a new PR, and it rests on decision 2.
    • Merge as is: not possible. It conflicts with main, contradicts the current guide, and has an open finding.
  2. Is the 5-minute worker split still wanted? (only if the PR is closed or reworked)
    • Re-plan it with /quest-plan as its own quest (recommended). First confirm the premise that sub-agents keep only a 5-minute cache. Include the gate-tickets quest and the starter-hold handoff, so the decision gets made against main's current skills.
    • Drop it, along with gate tickets.

Validation

  • just check passed at 811deae.
  • just test passed at abd9c65: 557 CLI/runner tests (2 skipped), 426 Worker tests, shell regression suites, and both CLI lifecycle checks. The only change after it is documentation.
  • test/agent.test.ts fails inside an agent session unless CLAUDE_CONFIG_DIR is unset. That's pre-existing and already tracked in agent test environment.

Review

Round 2: quest review, Codex gpt-6.1-sol, medium effort. Reviewed head 811deaef7e4550901f0de158217e970e24bc6977 against origin/main (01d051c): no findings.

  • Round 1 (head abd9c65) had one finding: a worker could push to a ready PR before the coordinator's checks and review. Fixed: workers push only to drafts, and the coordinator pushes to ready PRs after checks and review pass.
  • The earlier commits (through dc44496) were reviewed by Claude Opus 5.5 and approved.

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

@kixelated
kixelated marked this pull request as ready for review October 29, 2026 17:03
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 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-10-29T17:58:39.851393Z 811deae New commits
🔒 Security Review ✅ Completed 2026-10-29T18:00:57.083190Z 811deae New commits
ℹ️ 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.

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Automated review by review (OpenAI)

Reviewed commit: dc44496

No actionable bugs found. The removed CLI/runner waits and webhook wake transport are consistently disconnected, while one-shot context/status and landing-hold reconciliation remain. Successful delivery closes subsequent runner tools; a failed publication leaves delivery retryable. The added tests cover those boundaries without treating publication as proof that CI or landing finished.

Direction: separating a finite coding attempt from GitHub monitoring is a coherent simplification. The skills correctly distinguish the user's continuing merge decision from temporary ownership, require a fresh hold after ejection, and do not promise that this change starts a monitor.

Verification: GitHub-only static inspection of changed runtime, webhook/protocol, CLI and regression tests, plus an independent skills/ownership-handoff review. No builds, tests, agent lifecycle runs or deployment executed.

kixelated and others added 2 commits October 29, 2026 10:54
A background worker does one burst of short commands, records open
decisions in its PR, and terminates. The foreground coordinator keeps
its long session: it prompts the user, runs full checks and quest
review rounds in the worker's checkout, and starts a fresh worker for
each next burst instead of resuming one. Restore the interactive
review prompt, PR refreshes, and follow-up planning that the
long-running coordinators still do, and drop references to a GitHub
monitor that does not exist.

Plan ticketed gate admission and hook-started fixes for ejected
landings as follow-up quests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Workers push only to drafts; the coordinator pushes to a PR that is
ready for review once its checks and local review pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title refactor!: end coding agents at GitHub publication refactor!: stop waiting on GitHub and keep workers in a 5-minute cache Oct 29, 2026

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Automated review by review (OpenAI)

Re-reviewed commit 811deaef7e4550901f0de158217e970e24bc6977, focusing on the two commits since my review of dc44496cb215374a0f2a8fa0e76938456fa892ce.

The short-lived worker/foreground coordinator split is coherent, and keeping ready-PR pushes behind the coordinator's checks and review is the right boundary. One new handoff gap remains:

  • P2 — Release the starter-held draft when a completed worker hands it to the coordinator (assets/skills/start.md:26). A worker with no open decisions now pushes its draft and terminates without running /quest-review, but it leaves no ## Decisions needed handback marker. src/cli/hold.ts:128–129,303–306 therefore still classifies that draft as held by its starter and refuses the coordinator's quest ready <pr> with “taking it over is the user's choice.” The review skill's bypass is explicitly for a draft started in the same session, not one started by the terminated worker. This stalls the normal successful /quest-spawn path before the coordinator can perform the promised review. Define an explicit completed-worker ownership handoff that the coordinator can consume while keeping the PR draft, and cover worker completion → coordinator acquisition → local review in a regression.

The earlier CLI/runner wait removal is unchanged, not a new finding. GitHub-only static review of the delta, skills, and hold-acquisition implementation, with an independent handoff review; I did not run tests or agent lifecycle workflows.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Closing as superseded, per the maintainer's decision on 2026-11-01:

  • Skills no longer wait on GitHub. Main stopped this through moq-dev/quest#292 and moq-dev/quest#300.
  • The fixer is handled elsewhere. The ejected-landings fixer is replaced by the quest land fixer (moq-dev/quest#303, moq-dev/quest#355).
  • The quest wait removal conflicts with the current guide. It removes quest wait and the wake path, which the guide still uses to wait on CI and reviews.

The 5-minute worker/coordinator split and gate tickets will be planned again as their own quest, starting with a check that sub-agents really keep only a 5-minute cache. The branch stays available for reference.

(Written by Claude Opus 5.5)

@kixelated kixelated closed this Nov 1, 2026
moq-bot Bot pushed a commit that referenced this pull request Nov 1, 2026
* quest: plan the 2026-11-01 follow-ups (wip)

* quest: plan the 2026-11-01 follow-ups

Fifteen follow-ups the maintainer settled in a /quest-plan interview:
land work (fixer TLS, squash-mismatch comment, landing status), CLI and
agent fixes, runner review checks, and two m1 quests. Also brings
existing quests in line with #349, #276's close, validateFix, #246, and
#341.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* quest: leave review-login to #339 and build the gateway quest on it

#339 finishes and deletes review-login, including reviewing
with credentials from the environment. Narrowing it here would conflict
with that deletion, and the gateway quest would plan that work twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: moq-bot <moq-bot@users.noreply.github.com>
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.

1 participant