fix(threads): stop pull request watches when settling #16095
Merged
Bil0000(GitHub profile, opens in a new tab)merged 1 commit into
main fromrefs/pull/16095/head·merged by juliusmarminge View on GitHubShowing 5 changed files with 15 additions and 3 deletions (loading 2).
x
@@ -289,7 +289,7 @@
- "Have T3 Code watch an open pull request for this thread, linking it first if needed. T3 Code checks it every minute and wakes you with a message when a check fails, the required checks pass, someone else comments or reviews, or the branch starts to conflict with its base. Use this to monitor or babysit a pull request instead of polling, sleeping, or running a watcher. Only comments posted after this call wake you, so handle the existing ones first, then end your turn. A wake is news, not a merge decision: check readiness yourself before merging. Watching ends when the pull request merges or closes, when T3 Code cannot read it for 15 minutes, or when you call unwatch_pull_request.",
+ "Have T3 Code watch an open pull request for this thread, linking it first if needed. T3 Code checks it every minute and wakes you with a message when a check fails, the required checks pass, someone else comments or reviews, or the branch starts to conflict with its base. Use this to monitor or babysit a pull request instead of polling, sleeping, or running a watcher. Only comments posted after this call wake you, so handle the existing ones first, then end your turn. A wake is news, not a merge decision: check readiness yourself before merging. Watching ends when the pull request merges or closes, when its thread settles, when T3 Code cannot read it for 15 minutes, or when you call unwatch_pull_request. Unsettle the thread before starting a new watch.",
@@ -2368,6 +2368,17 @@
+ if (
+ command.type === "thread.pull-request.watch" &&
+ command.watching &&
+ (thread.settledOverride === "settled" || thread.settledAt !== null)
+ ) {
+ return yield* new OrchestratorDispatchError({
+ commandId: command.commandId,
+ commandType: command.type,
+ cause: `Thread ${command.threadId} is settled and cannot watch pull requests.`,
+ });
+ }