Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): report delegated tasks stopped by a server restart #13345

Closedsaphid(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/13345/headopened View on GitHub

What Changed

After a server restart, parents receive results for delegated children stopped by recovery on the first startup. Cancelled parent completion wakes are re-offered through the existing delivery path.

Recovery previously scanned children while constructing the orchestrator, before runtime recovery cancelled their runs. The live terminal reactor ignores those recovery events, so the result could remain missing until another restart. The report pass now runs after runtime recovery and before the effect worker starts.

Pending or running restart continuations defer cancellation reporting. An unreadable outbox also defers reporting rather than implying that no continuation exists. A skipped or final-failed continuation reconciles the child; retries and successful continuations leave reporting to the continued work. Existing deduplication and Stop/archive protections remain in the delivery path.

Why

Parents should learn when delegated work stops without waiting for another restart. This complements live blocked-request notifications in #14423; those notifications do not repair startup recovery.

Verification

  • 112 focused tests passed across startup, delegated delivery, runtime recovery, restart continuation, effect execution, background notes, thread management, relay and parent continuation suites on integrated target revision 2dfd3132.
  • The child regression invokes the real runtime recovery service with in-memory persistence, observes cancellation, and verifies one result after repeated reporting. Other focused tests cover pending/unreadable continuation, skipped/final-failed continuation, cancelled parent wakes, persisted-message deduplication and Stop/archive suppression.
  • Server typecheck, scoped lint/format and explicit Effect diagnostics passed. Independent GPT-6.1 Sol reviews found no actionable findings in the recovery change or its integration with the upstream namespace refactor at 2dfd3132; the latest reviewer independently reran all 112 tests and the server typecheck.
  • Upstream subsequently added the separate OpenCode compatibility policy change at 0fb3731e. It does not touch this contribution; the focused checks above were run on 2dfd3132, not that later integration.
  • Required lifecycle proof remains incomplete: no disposable saved database has yet been exercised through real server process restarts. First-restart parent follow-up, continuation across a second crash and suppression through that lifecycle remain to be verified. Service tests do not establish that proof, so this is not yet a merge-ready claim.

Checklist

  • This PR addresses one recovery concern
  • I explained what changed and why
  • No UI change; screenshots and video do not apply.

Original implementation: Claude Opus 5.5 using Claude Code (existing author attribution). Readiness repair: GPT-6 Astra using Codex in T3 Code. Independent review: GPT-6.1 Sol using Codex in T3 Code.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This PR changes production startup recovery and effect-settlement behavior across the orchestrator, runtime recovery service, effect worker, and delivery path. The cross-component lifecycle and durable outbox interactions warrant human review, especially since real process-restart behavior is not covered by the stated verification.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. juliusmarminge added labelsmacroscope-review

    4. juliusmarminge closed this

    5. juliusmarminge added labelstriage:keep-open

    6. juliusmarminge reopened this

    7. Warning

      Review limit reached

      Only developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing.

      Next included review available in 46 minutes.

      Check out review usage here.

      View limit details

      Limit details: You’ve used all 10 included reviews currently available.

      Learn how review limits work.

      Review configuration:

      ⚙️ Run configuration

      Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

      Review profile: CHILL

      Plan: Advanced

      Run ID: d3186cf1-51e3-4f28-8430-fd1b9b892676

      📥 Commits

      Reviewing files that changed from the base of the PR and between cc1e634bfa62edd56ff792eea666e436fdef788f and 79554dee89d017290c60048f01b4e015cfa245dc.

      📒 Files selected for processing (10)
      • apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts
      • apps/server/src/orchestration-v2/EffectWorker.ts
      • apps/server/src/orchestration-v2/Orchestrator.ts
      • apps/server/src/orchestration-v2/ProviderRuntimeRecoveryService.test.ts
      • apps/server/src/orchestration-v2/ProviderRuntimeRecoveryService.ts
      • apps/server/src/orchestration-v2/RestartContinuation.test.ts
      • apps/server/src/orchestration-v2/RestartContinuation.ts
      • apps/server/src/orchestration-v2/ThreadManagementService.ts
      • apps/server/src/relay/AgentAwarenessRelay.test.ts
      • apps/server/src/serverRuntimeStartup.ts
      • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Autopilot is currently an internal CodeRabbit preview.


      Comment `@coderabbitai help` to get the list of available commands.
    8. Review requested

      Date (UTC)ReviewerWhere
      2026-10-03JuliusDiscord DM
      2026-09-25JuliusDiscord DM
      Logged so this PR shows when a maintainer was asked to review it.
    9. Closing as superseded: main already covers this through #15323 (5108c978b1). recoverDelegatedTasks runs after reconciliation and before the effect worker starts, holds delegated child results until restart continuations settle, and re-offers interrupted completion deliveries. Reopen if a gap turns up.

Sign in to join this conversation.