enabling "continue threads after restarts" could wake an already-completed thread because leftover background tool or native subagent records counted as interrupted work, even with a stopped provider session. restart recovery now resumes only unfinished root turns or already-admitted continuations, and rejects stale deliveries targeting settled background work.
background cleanup still runs. its cancellation note reaches the provider once on the next manual turn. this applies to project and "no project" threads through the shared server path.
verified on blacksmith: 64 focused recovery, delegation, command-admission and provider-replay tests; server typecheck; targeted lint (one pre-existing unused-variable warning). the new regressions fail against the original production code, including the claude restart replay. a real claude client turn hit the existing weekly limit; after an actual isolated-server restart with continuation enabled, it retained exactly one failed run, no continuation effect, and no extra client message. live background-subagent reproduction remains unverified because of that quota; the recorded claude replay covers it. the pictured production threads are not available in this environment.
model: gpt-6-astra. harness: codex in t3 code.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes