{{ message }}
Repository navigation
fix: stop idle execution-control recovery polling - #17094
Open
cryppadotta wants to merge 7 commits into
Open
cryppadotta wants to merge 7 commits into
cryppadotta wants to merge 7 commits into
Conversation
Drive execution-control obligations from committed writes and persisted deadlines while retaining scoped retries and restart recovery. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Contributor
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This branch has not been deployed
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.

Thinking Path
Paperclip instances need to become quiet when they have no work, including releasing their idle database connections. Execution control still queried six recovery queues every 15 seconds after the MCP/Dot polling removal. These duties already have durable rows: most become actionable after a committed transition, while finalization and login cleanup have real deadlines. This PR routes those obligations through the existing transaction signals and delivery coordinator. Empty workers stop querying; unresolved work retains recovery.
Linked Issues or Issue Description
What happened?
On master
c6ee96a3df, the execution-control interval repeatedly queries for abandoned finalization, safe replacements, continuation delivery, status delivery, automatic disposition, and expired local logins. This happens with empty queues and retained completed history while the server is active.What did you expect to happen?
Inspect on startup, after relevant committed writes, or at a real deadline. Retry only while a concrete obligation or failed inspection remains unresolved.
Steps to reproduce
Start an otherwise empty server, let startup finish, and observe execution-control SQL continuing every 15 seconds. The new real-Postgres regression runs all six sweep implementations and checks that advancing beyond multiple former intervals produces no additional worker database calls.
Related work: #17036 and #15625. Searched for overlapping execution-control polling PRs; this extends the existing sleep work and does not add a new execution policy.
What Changed
Verification
pnpm -r typecheck: passed.pnpm build: passed.pnpm test:runattempt found four native-session integrity-test assertions that counted every post-provider transaction as recovery. Deadline publication now owns a separate transaction. Fault injection now targets the actual terminal-failure write; all 768 native-session tests passed after that correction, preserving protocol failure and no-provider-retry assertions. The original full-suite attempt was stopped after the correction to avoid duplicating final-head CI; it is not counted as a clean full run.db.updateafter the deadline write moved into a transaction. The fixture now intercepts the transactional write and preserves assertions for stopped renewal, released controls, and terminal status. Its focused regression, server typecheck, and all 407 heartbeat recovery tests passed.630c74c24a5/5, no actionable issues. Security review identified tenant-write amplification from immediate global sweeps; the final refinement implements its bounded-coalescing option at the previous 15-second per-queue budget. The security finding is resolved and its re-scan passed. Server suites, typechecks, and build passed on that revision. The mocked Slack setup browser test failed twice at its success-heading assertion after reload. Its test now waits for the restored “Send a message” screen before simulating the webhook, explicitly checking resume readiness; the timeout and completion assertions are unchanged. Before the fix, eight isolated local repetitions and the full 25-test shard passed, confirming the failure was intermittent. With the new readiness assertion, five repetitions passed. Final-head CI and review are running.Risks
The principal risk is an uninstrumented producer. Coverage includes the supported live server and shared
createDbowner scope; independent SQL writers or separate replicas must participate in the notification contract. Durable rows remain authoritative and startup reconstructs obligations. Existing recovery authority/evidence, atomic guards, and retries are preserved.This proves quiet for these workers, not provider suspension or fleet savings. Existing idle-safety blockers remain; no execution/login deadlines are newly exported to Cloud's external waker. Opted-in writes incur the existing transaction-ID notification cost.
Model Used
OpenAI GPT-6 through Codex, with reasoning, repository inspection, code execution, and test tools. A more specific serving model identifier and context-window size are not exposed in this session. No subagents implemented this change.
Checklist
Fixes: #/Closes #/Refs #OR (b) described the issue in-PR following the relevant issue template#NNN/github.com/paperclipai/paperclipURLs)docs/...,fix/...) and contains no internal Paperclip ticket id or instance-derived details