Skip to content

fix(types): align WikiComposeInterruptPayload human_review_research variant (batchId → batch) #980

Description

@coderabbitai

Summary

In server/api/src/agents/graphs/wikiCompose/types.ts (Line 212), the WikiComposeInterruptPayload discriminated union defines the human_review_research variant as:

| { kind: "human_review_research"; batchId: string | null; pendingSources: Source[] }

However, the actual interrupt node (server/api/src/agents/subgraphs/research/nodes/humanReviewResearch.ts) emits { batch: ResearchBatch | null, ... } — not batchId.

This type drift means any consumer using WikiComposeInterruptPayload as the source of truth will have a mismatched field name.

Proposed Fix

import type { ResearchBatch, Source } from "../../subgraphs/research/types.js";

export type WikiComposeInterruptPayload =
  | { kind: "human_review_brief"; questions: BriefQuestion[]; pageSnapshot: PageSnapshot }
  | { kind: "human_review_research"; batch: ResearchBatch | null; pendingSources: Source[] }
  | { kind: "human_review_outline"; outline: OutlineSection[]; approvedSources: Source[] }
  | { kind: "conflict_resolution"; conflicts: ResearchConflictSummary };

Context

/cc @otomatty

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions