Repository navigation
fix(server): stop dropping scheduled runs, subagent messages, retries, PR watches and draft uploads - #5
Merged
Conversation
A fixed-time task whose occurrence was more than 10 minutes late (machine asleep, server down) was silently rescheduled to the next day, so the work never ran. Drop the grace window: any due occurrence now runs when the scheduler can run it. The run's completion computes the next occurrence from the completion time, so a backlog of missed days produces one catch-up run, then the task continues on its normal schedule. Interval and one-time schedules already ran late occurrences this way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…reset A usage-limited thread was only armed for auto-resume while its reset time was less than 24 hours in the past. If the server was down or the machine asleep across that window, the pending recovery was dropped and the thread never continued. Remove the cutoff so a failed usage-limited thread is armed and resumed once its limit has reset, regardless of how late the server sees it. Archived, settled, and otherwise ineligible threads are still excluded by the existing checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…them Messages that arrive before their Claude subagent is registered are buffered until its task_started. The buffer held at most 64 subagents and 256 messages each, so a long early burst lost subagent output; evicted launch details (model, effort, owner) were dropped without any log. Raise the bounds to 4096 subagents and 65,536 messages each, append buffered messages in place so a long burst stays linear, and log a warning when launch details are evicted (message drops were already logged). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every orchestration effect gave up after 5 attempts with about 1.5 s of total backoff, so a transient failure in session detach or thread resource cleanup permanently abandoned the work (for example, leaving a provider process or terminal running) with only a warning in the log. Background effects that nobody waits on (provider-session.detach and the scheduled-task, terminal, preview, and attachment cleanups) now retry 28 times with exponential backoff capped at 30 s, about ten minutes in total, and the final give-up is logged as an error. Effects a user waits on (turn start, restart, interrupt, steer, answers, rollback, checkpoint capture, title generation, delegated stop, restart continuation) keep the short budget: retry backoff blocks the thread's later effects, and those types already show their failure to the user after the last attempt. Non-retryable interrupt failures still settle immediately. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After 8 failed reads in a row (about 16 minutes), the watch reactor stopped watching the pull request for good, so an outage or a temporary permission problem silently ended a watch the agent relied on. Keep the watch instead. After 8 failures in a row the agent gets one notice that reads are failing, and sweeps back off, doubling the wait from 4 minutes up to 30 minutes; host change feeds still read immediately. When a read succeeds again the agent is told it can read the pull request again. The separate stop after 10 comment-only wakes in a row is unchanged. The settle test now stops the watch it restarts: tests share one database, and later tests' reactors used to end that watch by failing to read it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Attachments uploaded to an unsent draft or prompt stash were deleted 24 hours after upload. Drafts live only on clients (web local storage, mobile state), so the server had no way to tell that a draft still referenced the upload, and a draft opened the next day lost its files. Clients already ask the server for an upload's asset URL whenever a draft is opened, a stash is restored, or a mobile draft is sent, to check the upload still exists. That request now refreshes the pending upload's timestamp, and the sweep deletes only pending uploads untouched for 30 days. Interrupted partial uploads are still removed after an hour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e limit reset" This reverts commit 55d9b7c.
The 24-hour limit only applies to arming a recovery for the first time. A recovery armed before the reset resumes however late the server sees it, for example after the machine slept through the reset. Cover that case so the scenario stays protected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A provider or model switch queues the old session's detach ahead of the new turn's start, and the outbox kept every later effect on a thread behind one waiting to retry. With background cleanup now retrying for about ten minutes, a failing detach could hold the user's turn for that long. Background cleanup effects (session detach and the thread resource cleanups) that have failed at least once no longer block the thread's later effects while they wait to retry. Before their first attempt they still run first, and effects a user waits on, such as rollback, still block as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fixed-time run missed by almost a day ran on catch-up and then again at its regular time minutes later. When a scheduled fixed-time run starts, its next occurrence is now counted from at least an hour after the start, so an occurrence due within that hour is skipped. Runs on time are unaffected, since fixed-time occurrences are at least a day apart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…arts The failed-read state was held only in memory: a restart could repeat the "cannot read it" notice and forgot to tell the agent when reads recovered. A pull request the host keeps reporting missing was also watched forever. The watch now records whether the agent was told reads are failing and when the host first reported the pull request missing. A restart reads again but does not repeat the notice, and the first successful read still sends the recovery notice and clears the state. If the host keeps reporting the pull request missing for 7 days, the watch ends with a visible notice. The notice no longer promises a follow-up that might not come, and the test now covers the 30-minute backoff cap. Both fields are optional, so watches saved earlier still decode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Raising the per-subagent limits left the early-frame buffer able to hold 4096 subagents of 65,536 messages each, with no bound on total memory. Frames buffered before their subagent registers now also share a 64 MiB session budget, measured by serialized size. A frame that would exceed it is dropped with the existing warning; released frames return their share. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server keeps a pending upload for 30 days after a client last asked about it, but the web client only asked when a draft was opened or a stash restored. A draft left unopened for a month lost its uploaded files even while the app was used daily. On load, and then about once a day, the app now asks each connected environment about the uploads that saved drafts and stash entries reference, one at a time, which refreshes them on the server. The composer guide now says how long unsent draft uploads are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…imits # Conflicts: # apps/server/src/orchestration-v2/PullRequestWatchReactor.ts # apps/server/src/orchestration-v2/runtimeLayer.test.ts # docs/user/source-control.md
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.
Several server rules silently dropped or abandoned work.
vp test run src/scheduledTasks/vp test runUsageLimitRecoveryWorkervp test runFoundationPersistence, EffectWorker, ThreadStop, RunFinalizationQueue, SelectionRestart.integration, ProviderSwitch.integrationvp test run src/orchestration-v2/runtimeLayer.test.tsvp test runClaudeAdapterV2vp test runattachmentStore, AssetAccess, GuestShareServicevp test run src/lib/draftUploadKeepAlive.test.ts(apps/web)vp run check:changedClaude Opus 5.5 via Claude Code (T3 Code).