feat(server): snooze a thread until its pull request needs attention#6

open1
main
t3code/attention-snooze-server
opened18d agobyOoliver
View on GitHubTwo-way sync enabledPR last imported 3d ago

Note

🤖 Claude Opus 5.5 on behalf of Oliver

Important

Bottom of a three-PR stack on this fork: server → web → mobile. Review in that order. The upstream PR will be a single squashed PR pointing back here.

Problem

An external contributor's pull requests often sit ready for days, waiting on a maintainer. Since pingdotgg/t3code#16204, a watched thread stays in Working, and agents are told to unwatch when they hand work back. That leaves two bad options: keep the thread visible while nothing is actionable, or unwatch and miss the maintainer's feedback when it arrives.

Fix

A thread can now be snoozed until its pull request needs attention: a snooze with no wake time, held by the thread's PR watches.

  • Entry points: a thread.snooze-until-attention command for clients, and an always-available MCP tool, snooze_until_pull_request_needs_attention. The tool uses the same writesThread access as watch_pull_request, respects Stop, and passes refusal reasons back to the agent. Both call PullRequestWatchReactor.snoozeUntilAttention.
  • Snapshot at snooze time: the snooze reads each linked PR from the host and starts its watch from that state. What the PR already shows never wakes the thread, and nothing that changes afterwards is missed. If a PR can't be read, the snooze is refused.
  • Waking: a failed check, required checks passing, outside comments or reviews, a conflict, give-up or comment-loop exhaustion all wake the agent as today. The thread returns to Working and the watch carries on as a normal watch. Waking it yourself ends the snooze and keeps the watch.
  • Merge or close: the thread settles regardless of sidebarAutoSettleOnMerge, with no reopening message. If the agent is mid-turn, it settles after the turn. If another linked PR is still open, the snooze ends instead.
  • No one-way doors: unwatch, Stop, unlink, settle and archive all end the snooze. Automatic settlement and usage-limit recovery never touch an attention snooze.
  • Check cadence: PRs watched only by attention-snoozed threads are checked every 10 minutes; shared ones stay at 2.
  • Opt-in agent guidance: the setting snoozePullRequestsAwaitingReview (off by default) tells agents, through the runtime instructions and watch wake text, to use the tool when a PR only waits on someone else's review. When it's off, nothing suggests the tool.
  • Representation: snoozedUntilNeedsAttention: true with snoozedUntil: null, plus the capability threadSnoozeUntilAttention so clients can gate the feature.
  • Docs: docs/user/source-control.md.

Validation

  • Ten adversarial review rounds with GPT-6.1-Sol against the acceptance criteria and for correctness, fixed with Claude Opus 5.5, until a round came back with no findings. Each fix added a regression test.
  • Focused tests: runtimeLayer, pullRequestWatch, ThreadStop, ThreadSettlementService, ProjectionSettlement, PR toolkit handlers, RuntimeInstructions, McpToolAccess, and ProviderSessionManager. Typecheck passes for contracts, shared, client-runtime, server, web and mobile.

Implemented by Claude Opus 5.5 subagents through the T3 Code orchestrator, reviewed by GPT-6.1-Sol (Codex), and coordinated by Claude Opus 5.5 in Claude Code within T3 Code.

Checks

Some checks failed

Added 1 commit

  • feat(server): snooze a thread until its pull request needs attention91256f4
Synced from GitHub

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 91256f4.

This comment will update automatically after the next completed run.