Repository navigation
engine: a quit with replies mid-stream finishes in seconds; idle CPU cuts (r9) - #2521
Merged
santoshkumarradha merged 9 commits intoNov 8, 2026
Merged
Conversation
…a failed save, an orphaned clock leaves at once
…as not moved; split Clock.Run under its ceiling
…one folder is not a failed save; the clock leaves with its window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the engine findings of WorkAF live e2e round 9: quits with jobs running hit the desk's 30 s kill, an idle quit exited 1 with "codeaf could not save this chat", the old
codeaf clockstayed ~30 s after its engine, and the idle engine read 6.3–7.4% of a core on macOS.Quit
provider.reconcile's retry pauses (1/4/15/20 s,ReceiptWait70 s) for the price of the call the quit cut.appBackend.Closecallsprovider.HurryReceipts: a pause ends, each owed receipt asks once more within 2 s and is recorded unpriced with its tokens; the app's close waits at most 3 s per conversation for receipts.Flushreported it at exit (exit 1). A capture or seal of a missing folder iscellstore.ErrWorkspaceGone: nothing to save. Rig: 3/3 exit 1 before, 0/3 after.closingGrace.Idle
Every write under the factory root wakes its watchers; on macOS each one re-lists the root through kqueue (13% of the before profile). Writes that said nothing new are gone:
leases.jsononce the stored renewal is 10 s old (lease.RenewalSettles), not every 2 s;Numbers
Rig: 84 + 2 held jobs, 35 open chats, 15 slots, stub model; idle = engine CPU over 120 s from 200 s after start; quit with 6 held step streams + 14 chats mid-reply.
leases.jsonrewritesmacOS steady profile: 3.03% → 2.10% of a core; what remains is lease reads on runner requests (17%) and the chat presence beat (13%). The rig does not follow a live AgentField run, which the live round's idle did; the AgentField write fix covers that path, and a live round confirms it.
make pr-ready BASE=origin/factory/general-intake: exit 0. Its 8-shardcmd/codeafrun had one failure,TestFactoryRetryActionsDoNotReportStopped/try_again(its rerun read revision 19 while the job was at 20); run alone it passes 2/2 on this head and 2/2 on the base, so it reads as load-dependent and is not from this change, which only removes writes.Manual: quitting the desktop app (receipts, gone folders) and the clock's leaving. PERF.md: "Quit and idle, the ninth live round". Change entry:
docs/changes/unreleased/2521-r9-quit-and-idle.md. Rebased onto #2520.🤖 Generated with Claude Code