Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): subagents stop burning tokens on pull request watch wakes #16217

Closedt3dotgg(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromt3code/audit-delegate-token-wasteopened View on GitHub

Showing 11 changed files with 51 additions and 1 deletion (loading 8).

x
0 of 11 viewed, 11 left
36 additions and 1 deletionapps/server/src/mcp/toolkits/pullRequests/handlers.test.tsModified
View file
@@ -13,6 +13,7 @@
import * as Layer from "effect/Layer";
import * as Option from "effect/Option";
import * as Ref from "effect/Ref";
+import * as Schema from "effect/Schema";
import * as Stream from "effect/Stream";
import type { Tool } from "effect/ai";
​
@@ -24,7 +25,11 @@
import * as ProjectService from "../../../project/ProjectService.ts";
import * as McpInvocationContext from "../../McpInvocationContext.ts";
import { listThreadPullRequests, PullRequestsToolkitHandlersLive } from "./handlers.ts";
-import { PullRequestLinkFailedError, PullRequestsToolkit } from "./tools.ts";
+import {
+ PullRequestLinkFailedError,
+ PullRequestSubagentWatchError,
+ PullRequestsToolkit,
+} from "./tools.ts";
​
const PROJECT_ID = ProjectId.make("project-1");
const THREAD_ID = ThreadId.make("thread-1");
@@ -279,6 +284,36 @@
}),
​
+ it.effect("tells a subagent it cannot watch, and still lets it unwatch", () =>
+ Effect.gen(function* () {
+ const harness = yield* makeHarness({