From 624538ac54a6860bb7b06ce29d6325905e65af25 Mon Sep 17 00:00:00 2001 From: Dotta Date: Thu, 27 Aug 2026 09:00:33 -0500 Subject: [PATCH] test(server): isolate question delivery imports --- .../issue-thread-interaction-routes.test.ts | 4 +++- .../__tests__/server-startup-feedback-export.test.ts | 12 ++++++++++++ server/src/index.ts | 2 +- server/src/routes/issues.ts | 1 + server/src/services/index.ts | 1 - 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/server/src/__tests__/issue-thread-interaction-routes.test.ts b/server/src/__tests__/issue-thread-interaction-routes.test.ts index 94048c4d61e..49d653c1f2b 100644 --- a/server/src/__tests__/issue-thread-interaction-routes.test.ts +++ b/server/src/__tests__/issue-thread-interaction-routes.test.ts @@ -149,6 +149,9 @@ vi.mock("../services/trust-preset-resolver.js", () => ({ })); function registerModuleMocks() { + vi.doMock("../services/question-response-delivery.js", () => ({ + questionResponseDeliveryService: () => mockQuestionResponseDeliveries, + })); vi.doMock("../services/index.js", () => ({ companyService: () => ({ getById: vi.fn(async () => ({ id: "company-1", attachmentMaxBytes: 10 * 1024 * 1024 })), @@ -210,7 +213,6 @@ function registerModuleMocks() { }), issueService: () => mockIssueService, issueThreadInteractionService: () => mockInteractionService, - questionResponseDeliveryService: () => mockQuestionResponseDeliveries, taskWatchdogService: () => ({ getActiveForIssue: vi.fn(async () => null), upsertForIssue: vi.fn(), diff --git a/server/src/__tests__/server-startup-feedback-export.test.ts b/server/src/__tests__/server-startup-feedback-export.test.ts index 9477122b7f8..54756413bb9 100644 --- a/server/src/__tests__/server-startup-feedback-export.test.ts +++ b/server/src/__tests__/server-startup-feedback-export.test.ts @@ -314,6 +314,18 @@ vi.mock("../services/index.js", () => ({ })), })); +vi.mock("../services/question-response-delivery.js", () => ({ + questionResponseDeliveryService: vi.fn(() => ({ + sweepPending: vi.fn(async () => ({ + scanned: 0, + steered: 0, + coalesced: 0, + wakeFallback: 0, + failed: 0, + })), + })), +})); + vi.mock("../services/secret-proposals.js", () => ({ createSecretProposalsService: vi.fn(() => ({ sweepExpired: vi.fn(async () => 0), diff --git a/server/src/index.ts b/server/src/index.ts index 759689bb8ec..8dbcd126231 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -59,7 +59,6 @@ import { issueThreadInteractionService, issueService, instanceSettingsService, - questionResponseDeliveryService, reconcileBuiltInAgentsOnStartup, reconcileCodexLocalManagedHomesOnStartup, reconcilePersistedRuntimeServicesOnStartup, @@ -68,6 +67,7 @@ import { toolAccessService, workspaceOperationService, } from "./services/index.js"; +import { questionResponseDeliveryService } from "./services/question-response-delivery.js"; import { queueIssueAssignmentWakeup } from "./services/issue-assignment-wakeup.js"; import { createSecretProposalsService } from "./services/secret-proposals.js"; import { environmentRuntimeService } from "./services/environment-runtime.js"; diff --git a/server/src/routes/issues.ts b/server/src/routes/issues.ts index ab3568c7c7c..97597c16649 100644 --- a/server/src/routes/issues.ts +++ b/server/src/routes/issues.ts @@ -144,6 +144,7 @@ import { routineService, workProductService, } from "../services/index.js"; +import { questionResponseDeliveryService } from "../services/question-response-delivery.js"; import { artifactReviewDocumentService } from "../services/artifact-review-documents.js"; import { assertCanResolveProposal } from "../services/secret-proposal-authorization.js"; import { buildDocumentReviewContext, buildPlanReviewContext } from "../services/plan-review-context.js"; diff --git a/server/src/services/index.ts b/server/src/services/index.ts index 1877943f6d6..da5ce5b77ba 100644 --- a/server/src/services/index.ts +++ b/server/src/services/index.ts @@ -42,7 +42,6 @@ export { type IssueFilters, } from "./issues.js"; export { issueThreadInteractionService } from "./issue-thread-interactions.js"; -export { questionResponseDeliveryService } from "./question-response-delivery.js"; export { assertIssueReviewVerdictActorAllowed, type IssueReviewVerdictActor,