Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(threads): stop pull request watches when settling #16095

MergedBil0000(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/16095/headmerged by juliusmarminge View on GitHub

Showing 5 changed files with 15 additions and 3 deletions (loading 2).

x
0 of 5 viewed, 5 left
1 addition and 1 deletionapps/server/src/mcp/toolkits/pullRequests/tools.tsModified
View file
@@ -289,7 +289,7 @@
​
const WatchPullRequestTool = Tool.make("watch_pull_request", {
description:
- "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.",
parameters: PullRequestTargetInput,
success: WatchPullRequestResult,
failure: PullRequestToolError,
12 additions and 0 deletionsapps/server/src/orchestration-v2/Orchestrator.tsModified
View file
@@ -2368,6 +2368,17 @@
threadId: command.threadId,
+ 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.`,
+ });
+ }
command.type === "thread.metadata.update" &&