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
Summary
In
server/api/src/agents/graphs/wikiCompose/types.ts(Line 212), theWikiComposeInterruptPayloaddiscriminated union defines thehuman_review_researchvariant as:However, the actual interrupt node (
server/api/src/agents/subgraphs/research/nodes/humanReviewResearch.ts) emits{ batch: ResearchBatch | null, ... }— notbatchId.This type drift means any consumer using
WikiComposeInterruptPayloadas the source of truth will have a mismatched field name.Proposed Fix
Context
/cc @otomatty