The best way to control Claude Code, Codex and more from any computer or phone
fix(server): unlink_pull_request reports a dismissed stack PR as not linked (#25561)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net>
MarcoDotIO committed
Nov 1, 2026 at 15:58 UTC
68565006359c64787a9699a5c546a0c4a652d241
2 files changed
+19
-1
apps/server/src/mcp/toolkits/pullRequests/handlers.test.ts
+14
@@ -517,6 +517,20 @@ describe("pull request toolkit handlers", () => {
517
}),
518
);
519
520
+ it.effect("reports a dismissed stack member as not linked and leaves it dismissed", () =>
521
+ Effect.gen(function* () {
522
+ const harness = yield* makeHarness({
523
+ thread: makeThread([makeLink(9, { source: "stack-dismissed" })]),
524
+ });
525
+ const result = yield* harness.call("unlink_pull_request", {
526
+ repository: "t3tools/t3code",
527
+ number: 9,
528
+ });
529
+ expect(result.wasLinked).toBe(false);
530
+ expect(yield* Ref.get(harness.commands)).toEqual([]);
531
+ }),
532
+ );
533
+
534
it.effect("links several pull requests in one call", () =>
535
Effect.gen(function* () {
536
const harness = yield* makeHarness({
apps/server/src/mcp/toolkits/pullRequests/handlers.ts
+5
-1
@@ -446,7 +446,11 @@ const make = Effect.gen(function* () {
446
const thread = yield* requireThread(PullRequestUnlinkFailedError, input.threadId);
447
const project = yield* projectOf(thread, PullRequestUnlinkFailedError);
448
const target = yield* resolveTarget(input, project);
449
- if (!threadPullRequestsOf(thread).some((link) => threadPullRequestKeysEqual(link, target)))
449
+ if (
450
+ !threadPullRequestsOf(thread).some(
451
+ (link) => link.source !== "stack-dismissed" && threadPullRequestKeysEqual(link, target),
452
+ )
453
+ )
454
return {
455
host: target.host,
456
repository: target.repository,