Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): PR watches stop burning GitHub's rate limit and giving up #16208

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/16208/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 13 changed files with 54 additions and 4 deletions (loading 10).

x
0 of 13 viewed, 13 left
35 additions and 0 deletionsapps/server/src/mcp/toolkits/pullRequests/handlers.test.tsModified
View file
@@ -279,6 +279,41 @@
}),
​
+ it.effect("watches a pull request saved as closed, since it may have reopened", () =>
+ Effect.gen(function* () {
+ const closed = makeLink(1, { headBranch: "closed" });
+ const harness = yield* makeHarness({
+ thread: makeThread([
+ { ...closed, snapshot: closed.snapshot && { ...closed.snapshot, state: "closed" } },
+ ]),
+ });
+ yield* harness.call("watch_pull_request", { repository: "t3tools/t3code", number: 1 });
+ expect(yield* Ref.get(harness.commands)).toMatchObject([
+ { type: "thread.pull-request.watch", number: 1, watching: true },
+ ]);
+ }),
+ );
+​
+ it.effect("refuses a watch from a subagent thread, whose parent owns the pull request", () =>
+ Effect.gen(function* () {
+ const harness = yield* makeHarness({
+ thread: {
+ ...makeThread([makeLink(1, { headBranch: "feature" })]),
+ lineage: {
+ rootThreadId: ThreadId.make("parent"),
+ parentThreadId: ThreadId.make("parent"),
+ relationshipToParent: "subagent",
+ },
+ },