Skip to content

fix(server): recover queued runs and alert on stranded queues - #177

Merged
nullStack65 merged 4 commits into
release/native-0.1.10from
fix/stranded-queue-watchdog
Nov 23, 2026
Merged

nullStack65 merged 4 commits into
release/native-0.1.10from
fix/stranded-queue-watchdog

Conversation

@nullStack65

@nullStack65 nullStack65 commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

A terminal provider failure could leave the next queued turn held indefinitely. Startup reconciliation could also hold an idle queue after its active run had already ended.

Startup now preserves eligible idle queues and promotes them through the same per-thread lock, delivery order, and transactional outbox as the terminal-run handler. The existing process-loss holds, provider and workspace gates, intentional stops, usage limits, and continuation backoff still apply. Snooze and pending runtime requests block promotion. The existing thread-event sweep sends the launching thread a stuck alert once per queue incident, strictly after 15 minutes. STRANDED_QUEUE_MS keeps that threshold separate from the configurable active-run quiet threshold.

Repair round

Reviewed head 0aa64534c381dba336bc7df8d5b712b56db527ea. Release base 18cf8f27f1df245acf78bbbbbea34c1475f4585a.

  1. Missing provider instances hold queued runs at the existing disabled-provider gate and preserve their order.

  2. The sweep and delivery recheck suppress intentionally held queues.

  3. A pending delivery deduplicates while queued. A dropped alert can return after the hold clears. Successful delivery deduplicates the rest of the incident.

  4. A scoped wake at the current snooze deadline re-enters native promotion under the existing per-thread lock. Changing the deadline replaces the wake.

  5. Startup reconciliation keeps linked delegated follow-ups held so their parent task becomes idle.

  6. A provider failure with unknown retryability holds the queue. An explicitly retryable ordinary provider failure can still advance it.

  7. Pause/resume now declares the mock provider in settings as well as the registry. The missing-provider gate introduced in the first repair correctly held this unconfigured queue, so the test waited for a running event that could not occur. The fixture change already in the current repair exercises resume with an available provider. The test expectations and provider gate remain intact.

The first three revisions use byte-identical DelegatedCompletionDelivery.test.ts fixtures and the same serial command. The current repair cbdb69fbf9d855512c18ffe0c0e9a8e96947fbd4 uses the corrected settings fixture. First repair 7506a8b96da761106aa1170c46e862d04e3be352 reproduced both hosted ARC timeouts locally.

DelegatedCompletionDelivery case Release base 18cf8f27 Reviewed 0aa64534 First repair 7506a8b9 Current repair cbdb69fb
holding a follow-up during runtime recovery makes its parent task idle Pass Timeout (120 s) Timeout (120 s) Pass
pauses queued follow-up cards and resumes them Pass Pass Timeout (120 s) Pass
settles a child whose provider failure holds its queued wakes Pass Fail (failed/false, expected queued/true) Pass Pass

The provider-failure case passed on the first repair because the old fixture encountered the missing-provider gate first. With a configured provider, it still produced failed/false there. The current repair preserves the provider-failure hold and passes with the configured provider.

The current repair passed all 67 delegated-completion tests serially, 23 selected orchestration tests, and 124 recovery, alert and startup tests, plus server typecheck and changed-file lint and formatting. The startup timeout used one successful arc-hold-timeout attempt. Pause/resume traces to finding-1 and the fixture correction already covered by arc-provider-failure-hold. The latter guard used one successful attempt. Findings 1 and 3 reopened for typecheck diagnostics. Finding 4 reopened when a shortened snooze missed its new deadline. The isolated deployed canary remains required.

Test proof

On base 18cf8f27f1df245acf78bbbbbea34c1475f4585a, handles a queued message after a provider_error failure and both recovers a persisted … run's queued messages in FIFO order without duplicate starts cases left the next run queued instead of starting. stuck: a stranded queue reports strictly after 15 minutes with a stable incident signature had no finding after the threshold. The fixed cases assert durable promotion, FIFO and a single start effect when recovery calls race. Additional assertions cover snooze, approvals, intentional interrupt, usage and restart backoff, process-loss holds, and alert deduplication across sweeps and queue progress.

deduplicates a stranded queue until the queue advances or drains emitted again after a temporary gate on the base reactor. recovers queued work after restart wrote an unexpected hold on the base recovery service. Both pass at the PR head.

Local verification passed 29 orchestration, alert, and startup tests plus 26 recovery tests, server typecheck, and changed-file lint and formatting. The local commit hook was skipped for this commit after its repository-wide Knip run flagged four untouched release-base scripts.

Runtime limits

Recovery replay and the race use the in-process SQLite testkit. A live provider restart, acceptance across a provider crash, and delivery to a real launching thread remain unverified. An in-flight run whose acceptance is uncertain still follows the existing recovery policy. Deployment remains pending.

Chief of Staff watchdog

The T3 Code, Closura Home, and Closura HQ project schedule lists each returned no tasks. A read-only search of the shared agent configuration found no matching Auto-Watchdog job or stranded-queue prompt. The operator can retire the polling job after identifying it and verifying native recovery and alert delivery on the deployed build.

Prior art

  • Extend the existing terminal-run reaction and startup recovery. They already serialize promotion and commit the provider start intent with its state change.
  • Extend the existing model-alert sweep and persisted delivery state. Detection runs at the existing sweep cadence and requires a valid launcher or webhook.

Model: gpt-6.2-sol
Task: fix
Deploy: fleet

Implemented with GPT-6.2 Sol in the Codex harness.

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
…ilures

Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
@nullStack65

Copy link
Copy Markdown
Owner Author

The existing independent review is complete. Its focused recheck confirmed all four findings on repaired head cbdb69fbf9d855512c18ffe0c0e9a8e96947fbd4. The hosted replacement core, web and mobile shards passed. The required founder-inbox aggregate is queued. Installed restart recovery, 15-minute alert timing and launcher digest delivery still need their own canary. Original review · Focused recheck

{"reviewed_head":"0aa64534c381dba336bc7df8d5b712b56db527ea","reviewer":"GPT-6.2 Sol via Codex Magpie, original independent review and focused recheck","findings":[{"id":"F1","severity":"important","summary":"Removed providers preserve queued runs and order","outcome":"confirmed","rechecked_head":"cbdb69fbf9d855512c18ffe0c0e9a8e96947fbd4"},{"id":"F2","severity":"important","summary":"Intentional holds suppress stranded-queue alerts","outcome":"confirmed","rechecked_head":"cbdb69fbf9d855512c18ffe0c0e9a8e96947fbd4"},{"id":"F3","severity":"important","summary":"Dropped alerts may retry after a temporary hold","outcome":"confirmed","rechecked_head":"cbdb69fbf9d855512c18ffe0c0e9a8e96947fbd4"},{"id":"F4","severity":"important","summary":"Snooze expiry retries normal queue promotion","outcome":"confirmed","rechecked_head":"cbdb69fbf9d855512c18ffe0c0e9a8e96947fbd4"}]}

@nullStack65
nullStack65 merged commit c21b68e into release/native-0.1.10 Nov 23, 2026
12 of 16 checks passed
@nullStack65
nullStack65 deleted the fix/stranded-queue-watchdog branch November 23, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants