Skip to content

Implementors run their own review; the orchestrator wakes only to merge or decide #513

Closed

Description

@tannerpolley

Problem (owner, 2026-11-20)

Today a PR goes implementor → orchestrator → separate Reviewer thread → orchestrator → fix round → orchestrator → re-check → orchestrator → merge. That is four or more orchestrator wakes per PR. Each wake re-reads the orchestrator's whole long thread from cache, and that is where most of the usage goes (#506 found 97% cache reads). The handoffs also look odd: between the implementor finishing and the review, the work looks paused instead of in progress. Transient provider failures add more wakes. On 2026-11-20 Codex 503s and stream drops woke the orchestrator six times, once per dropped worker, and each time it only resent the task.

The orchestrator should manage merging, building, ordering and owner decisions. It should not relay every step.

Wanted

  1. The implementor owns its review loop.
    • After its checks pass and the PR is pushed, the implementor spawns its provider's native read-only reviewer subagent: Codex reviewer (~/.t3/provider-homes/codex/agents/reviewer.toml), or the Claude reviewer agent.
    • It gives the reviewer the issue, plan and diff, not its own conclusions.
    • It fixes real defects and re-reviews only material changes.
    • It dismisses other findings with a written reason.
    • It asks through the question tool before a third fix round.
    • It returns its final result only when the PR is merge-ready, listing each finding as fixed or dismissed with the reason.
  2. Status stays in progress through review. The issue and worker show In progress, not paused or done, until the implementor's final result.
  3. The orchestrator's role text matches. The injected orchestration text says "Every new delegate review or re-check is a new delegate_task" (packages/provider-core/src/server/orchestrationInstructions.ts:18). It changes so that a separate Reviewer thread is used only when the owner or the plan asks for an independent review. The implementor role text gains the review loop above, briefly. Keep within Codex's 4,000-byte cap.
  4. Transient provider errors retry in place. A worker turn that fails with a transient provider error (HTTP 503 or 502, "stream disconnected before completion", "error decoding response body") resumes the same thread after a backoff, a bounded number of times, before reporting failure to the parent. Persistent failures and usage limits still wake the parent at once.

Done when

  • A managed implementor delegated with an issue runs build → own review → fixes → final result, and the parent gets one wake for the merge-ready result. Shown with a Replay or test run, no paid evals.
  • The issue and worker status read In progress during the review.
  • A simulated transient provider failure retries without a parent wake. Repeated failure still wakes the parent once.
  • The role text checks pass, including the Codex byte cap.

Related

Mobile is out of scope. Only Codex and Claude matter.

Activity

  1. tannerpolley commented on Nov 20, 2026

    @tannerpolley
    OwnerAuthor

    More evidence from #494 (2026-11-20). The implementor started its reviewer as a T3 child thread, then ended its turn while waiting. Each time, T3 delivered a "completed" result to the orchestrator even though the review was still running and would wake the implementor, not the orchestrator. That was two extra orchestrator wakes with nothing to act on. While a managed implementor has its own child running, ending its turn should not count as a final result to the parent.

  2. tannerpolley commented on Nov 20, 2026

    @tannerpolley
    OwnerAuthor

    Blocker found on 2026-11-20. The #504 implementor (managed Codex worker) was told to spawn its native reviewer subagent and reported that "This managed session disables native subagents." So today a managed implementor cannot run its own review. This issue must turn native read-only subagents on for managed implementor sessions, at least for the reviewer, or find where T3 turns them off. Until then, the orchestrator delegates a separate Reviewer.

  3. tannerpolley commented on Nov 20, 2026

    @tannerpolley
    OwnerAuthor

    T3 Code status: Unavailable

    Issue: #513 Implementors run their own review; the orchestrator wakes only to merge or decide

    Thread: thread:delegated-task:command%3Amcp%3Ae1f41a65-055a-482d-99db-fafa04341583%3Adelegate-task%3Aimplement-513-2026-11-20

    Model: gpt-6.2-sol

    Branch: issue-513-implementors-run-their-own-review-the

    Updated: 2026-11-21T00:13:52.823Z

  4. added this to the Fork backlog milestone on Nov 20, 2026
  5. tannerpolley commented on Nov 20, 2026

    @tannerpolley
    OwnerAuthor

    T3 Code closeout: done

    Issue: #513 Implementors run their own review; the orchestrator wakes only to merge or decide
    Thread: thread:delegated-task:command%3Amcp%3Ae1f41a65-055a-482d-99db-fafa04341583%3Adelegate-task%3Aimplement-513-2026-11-20
    Model: gpt-6.2-sol
    Branch: issue-513-implementors-run-their-own-review-the
    Completed: 2026-11-20T23:02:24.920Z

    Implemented #513 and pushed draft PR #522. A managed implementor can run its provider’s native reviewer, stay In progress through review, and deliver one merge-ready result to the orchestrator. Independent review is pending.

    Evidence against main at d8fdc04789

    Done when On main On the PR branch
    The implementor owns review and the parent gets one wake Managed implementors had native subagents disabled. A T3 reviewer’s result could also give a resumed implementor a new task ID, releasing its earlier task prematurely. Codex and Claude session tests verify reviewer availability. The managed delegation test simulates review and fixes, keeps the original task open, and records exactly one parent wake after the final result.
    The issue and worker stay In progress The server reported waiting_on_sub_issues and the web issue appeared Paused. The server reports working for the issue and worker, and the web issue shows In progress while review runs.
    Temporary provider failures retry before waking the parent Simulated connection failures settled the worker immediately. The same thread retries after two seconds and then four seconds. Tests verify that recovery and exhaustion each deliver one final wake. Persistent failures and usage limits still wake the parent immediately.
    Role text checks pass The injected text directed every new review to delegate_task and lacked the implementor’s native review loop. A separate Reviewer is reserved for an independent review requested by the owner or plan. The five-role text passes the Codex 4,000-byte cap and all 1,004 free eval checks.

    Mechanisms located

    • Native subagent switches. t3OrchestrationPolicy supplies the flag. Codex applies it in codexThreadRuntimeParams and Claude in claudeMcpQueryOverrides. Commit 467ec62e08 moved delegation tools to the direct MCP server, which made two Codex test expectations stale. Both now pass. Shared policy, Codex adapter, Claude adapter
    • Injected review instructions. The separate-review rule and the implementor’s review loop live in the shared orchestration instructions. Review rule, Implementor instructions
    • Turn completion and parent wake. handleRunUpdate invokes delegated-task finalization, and ProviderContinuationService delivers the result. recordSubagentFollowup now keeps the reviewer’s wake on the implementor’s open task. Run update, Result delivery, Follow-up recording
    • Issue and worker status. deriveIssueWorkStatus supplies server status, IssueWorkService.childrenStatus groups workers, and the web issue list applies live thread state. Server status, Worker grouping, Web status

    Focused tests and touched-package type checks passed. check:changed passed 1,453 tests and finished with the three mobile type errors and two runtimeLayer failures tracked in #470. The HTML render timeout reproduced on d8fdc04789. The coordinator ordering test passed in isolation on main and failed in both aggregate runs on the branch.

    The baseline ran in a temporary detached worktree because main was already checked out. Review behavior was verified with local tests and adapter fixtures. No paid provider run or dev server was used.

    PR #522, head 6268933766bf6eca5fc4e0a81c3943141ae5007a, checks and reviews: focused checks passed, aggregate failures listed above, no hosted checks reported, independent review pending.

  6. tannerpolley commented on Nov 20, 2026

    @tannerpolley
    OwnerAuthor

    Owner decision (2026-11-20, after the PR #522 review): the implementor gets its review from a T3 reviewer child, not a native subagent. Turning on native subagents for managed implementors also lets them start general-purpose, writable worktree children on both Claude and Codex, and the global rules forbid that. With a T3 reviewer child, the reviewer is read-only by role, its result returns to the implementor, and the orchestrator still gets one wake per PR.

  7. tannerpolley commented on Nov 20, 2026

    @tannerpolley
    OwnerAuthor

    T3 Code closeout: done

    Issue: #513 Implementors run their own review; the orchestrator wakes only to merge or decide
    Thread: thread:delegated-task:command%3Amcp%3Ae1f41a65-055a-482d-99db-fafa04341583%3Adelegate-task%3Aimplement-513-2026-11-20
    Model: gpt-6.2-sol
    Branch: issue-513-implementors-run-their-own-review-the
    Completed: 2026-11-20T23:35:29.374Z

    Fix round 1 is committed locally at 0d481e6e1a. The interruption came before the push and PR description update.

    • Managed implementors now use an async T3 Reviewer child. Codex and Claude tests confirm native spawning is disabled, and the role text passes Codex’s 4,000-byte cap.
    • The retry tests reproduced both classification errors on the previous head. The Claude 401 now stops immediately, and Codex’s structured stream disconnect retries even when its message only says “Connection lost.”
    • The code and docs now describe the continuation as asking the model to verify earlier actions before repeating them. The draft PR description update is prepared locally.
    • The existing Flag quiet workers and wake their parent after 10 minutes without activity #496 alert woke the implementor once when its reviewer went quiet. The test needed no new escalation.
    • A failed worker stays Failed with a shell command pending. The original build test records one orchestrator wake after review and fixes, and separate tests confirm both immediate question routes.

    The focused run passed 1,143 tests and free eval checks. Another 29 Codex terminal cases and the touched-package type checks passed. check:changed reported the three known mobile type errors. Its final test result was unconfirmed at interruption. No paid provider run was used.

    PR #522, head 6268933766bf6eca5fc4e0a81c3943141ae5007a, checks and reviews: fix round 1 remains local, aggregate result unconfirmed, re-review pending.

  8. tannerpolley commented on Nov 20, 2026

    @tannerpolley
    OwnerAuthor

    T3 Code closeout: done

    Issue: #513 Implementors run their own review; the orchestrator wakes only to merge or decide
    Thread: thread:delegated-task:command%3Amcp%3Ae1f41a65-055a-482d-99db-fafa04341583%3Adelegate-task%3Aimplement-513-2026-11-20
    Model: gpt-6.2-sol
    Branch: issue-513-implementors-run-their-own-review-the
    Completed: 2026-11-20T23:47:06.755Z

    Pushed fix round 1 to the same branch without force-pushing and updated draft PR #522. The description now covers the async T3 Reviewer child, structured retry classification, and the verification prompt Codex receives on a temporary retry. The prompt asks the model to check earlier actions before repeating them. An action may already have taken effect.

    I merged main into the feature branch to pick up the existing runtime test fixes. The final check:changed run passed 1,470 tests across 32 files and every other check stage except type checking. It exited 1 solely for the three known mobile type errors.

    PR #522, head 140116ee9d0a71e9e2346f5bd4b2df806fd7b123, checks and reviews: check:changed failed only on the three accepted mobile type errors, independent re-review pending.

  9. tannerpolley commented on Nov 21, 2026

    @tannerpolley
    OwnerAuthor

    T3 Code closeout: done

    Issue: #513 Implementors run their own review; the orchestrator wakes only to merge or decide
    Thread: thread:delegated-task:command%3Amcp%3Ae1f41a65-055a-482d-99db-fafa04341583%3Adelegate-task%3Aimplement-513-2026-11-20
    Model: gpt-6.2-sol
    Branch: issue-513-implementors-run-their-own-review-the
    Completed: 2026-11-21T00:04:02.113Z

    1. Fixed restart recovery to preserve the retry marker that makes Codex send the verification prompt. Test: persists recovery for count 1, starting work, retry 2.
    2. Fixed verdict routing to use the review’s parent run ID, keeping an intervening status request from closing the build early. Test: keeps the follow-up build task open through review and reports the fixed verdict to its parent once.
    3. Fixed retry classification for the confirmed Codex disconnect reported as other with Connection lost. Test: classifies confirmed generic Codex disconnect by structured evidence first.
    4. Fixed retry classification to honor a 401 in the message before considering the connection error code. Test: classifies Codex connection error with HTTP 401 in its message by structured evidence first.

    PR #522, head 10f1db5a4514d39f5d78a6e44539af78831bb57a, checks: check:changed passed 1,504 tests across 35 files and exited 1 solely for the three known mobile type errors. Owner decision pending.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions