Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a PR watch the agent owns keeps its thread working until the PR merges #38926

Mergedjuliusmarmingemerged 3 commits intomain fromrefs/pull/38926/headmerged by juliusmarminge View on GitHub

Showing 14 changed files with 77 additions and 47 deletions (loading 11).

x
0 of 14 viewed, 14 left
10 additions and 7 deletionsapps/server/src/mcp/toolkits/pullRequests/handlers.tsModified
View file
@@ -2,6 +2,7 @@
CommandId,
type OrchestrationProjectShell,
type PullRequestState,
+ type PullRequestWatchUntil,
type OrchestrationV2ThreadShell,
type ThreadId,
type ThreadPullRequestLink,
@@ -199,18 +200,20 @@
​
// The domain service owns the registration span.
const setWatching = Effect.fnUntraced(function* (
- input: PullRequestTargetInput,
+ input: PullRequestTargetInput & { readonly until?: PullRequestWatchUntil | undefined },
watching: boolean,
) {
const scope = yield* McpInvocationContext.requireMcpCapability("pull-requests");
const threadId = input.threadId ?? scope.thread?.threadId;
if (threadId === undefined) return yield* new PullRequestThreadRequiredError();
- return yield* watches.setWatching({ threadId, target: input, watching }).pipe(
- Effect.catchTags({
- PullRequestWatchThreadNotFoundError: (error) =>
- threadNotFound(engine, scope, error.threadId, error.message),
- }),
- );
+ return yield* watches
+ .setWatching({ threadId, target: input, watching, until: input.until })
+ .pipe(
+ Effect.catchTags({