Skip to content

fix(server): wake threads when watches and waits go stale - #179

Draft
nullStack65 wants to merge 6 commits into
release/native-0.1.10from
t3/mandatory-wait-monitor-staleness-timeout-clo1133
Draft

nullStack65 wants to merge 6 commits into
release/native-0.1.10from
t3/mandatory-wait-monitor-staleness-timeout-clo1133

Conversation

@nullStack65

@nullStack65 nullStack65 commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

PR watches and background waits can go quiet indefinitely when a check stays queued or a child stops making progress. Give each wait a durable idle deadline. PR watches default to 30 minutes. Background waits, native monitors and awaited delegations default to 45 minutes. The MCP tools accept a 5–1440 minute override.

The existing server sweeps wake the owning thread with one diagnostic per quiet period. Progress re-arms the deadline, and unwatching or completion cancels it. SQLite retains the deadline and alert state across restarts. The tests exercise the deadlines using a deterministic clock and projection replay.

Deploy: none

Implemented with GPT-6.2 Sol in Codex.

Test change on rebase (note: CI does not run runtimeLayer.test.ts)

handles repeated host read failures (both variants) holds the watch unreadable for exactly 30 minutes, which is PR_WATCH_STALE_MINUTES. stalePullRequestWatch fires at idle >= the timeout (inclusive), so the stale notice now appears once at the final sweep. The cases now expect #8: no observed progress for 30 minutes before the recovery summaries, compared order-insensitively. Verified locally: the same two cases failed on the original PR head too, and pass after this change (5 passed in the filtered run). The earlier green CI did not cover this file.

@nullStack65
nullStack65 marked this pull request as ready for review November 23, 2026 08:40
@coderabbitai

coderabbitai Bot commented Nov 23, 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

@nullStack65
nullStack65 marked this pull request as draft November 23, 2026 08:42
@nullStack65
nullStack65 marked this pull request as ready for review November 23, 2026 16:57
@nullStack65
nullStack65 marked this pull request as draft November 23, 2026 17:00
@nullStack65
nullStack65 force-pushed the t3/mandatory-wait-monitor-staleness-timeout-clo1133 branch 2 times, most recently from 28ef7b8 to b53001f Compare November 24, 2026 04:45
@nullStack65
nullStack65 marked this pull request as ready for review November 24, 2026 04:45
@nullStack65
nullStack65 marked this pull request as draft November 24, 2026 05:14
nullStack65 and others added 6 commits November 24, 2026 00:16
Model: gpt-6.2-sol
Task: fix
Agent: Codex
Lane: codex
Model: gpt-6.2-sol
Task: fix
Agent: Codex
Lane: codex
Model: gpt-6.2-sol
Task: fix
Agent: Codex
Lane: codex
Persist background wait deadlines before provider enrollment and recover older awaited work. Deliver active-run diagnostics through system notices, refresh queued groups at delivery, and keep PR watch overrides and intentional holds intact.

Model: gpt-6.2-sol
Task: fix
Agent: Codex
Lane: codex
Harness: t3/codex
Place the deadline helper with the staleness handlers so the sibling snooze-queue repair applies cleanly.

Model: gpt-6.2-sol
Task: fix
Agent: Codex
Lane: codex
Harness: t3/codex
…dable

The repeated-host-read-failures cases keep a watch unreadable for exactly the
30 minute stale window. The watch now wakes the thread once about the missing
progress, so these cases expect that notice before the recovery summaries.

Model: claude-sonnet-5-5
Task: test
Agent: Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@nullStack65
nullStack65 force-pushed the t3/mandatory-wait-monitor-staleness-timeout-clo1133 branch from b53001f to 5c8a499 Compare November 24, 2026 05:16
@nullStack65
nullStack65 marked this pull request as ready for review November 24, 2026 05:18
@nullStack65
nullStack65 marked this pull request as draft November 24, 2026 05:22

This branch has not been deployed

No deployments
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.

3 participants