Skip to content

Commit 3ff2d1c

Browse files
committed
fix(observability): tolerate missing report phase iteration
1 parent f14c374 commit 3ff2d1c

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/__tests__/engine-happy-path.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,12 +596,12 @@ describe('WorkflowEngine Integration: Happy Path', () => {
596596
systemPrompt: expect.any(String),
597597
userInstruction: expect.any(String),
598598
}),
599-
undefined,
599+
'plan:1:1:1',
600600
1,
601601
);
602602
expect(phaseCompleteFn).toHaveBeenCalledWith(
603603
expect.objectContaining({ name: 'plan' }),
604-
1, 'execute', expect.any(String), 'done', undefined, undefined, 1,
604+
1, 'execute', expect.any(String), 'done', undefined, 'plan:1:1:1', 1,
605605
);
606606
});
607607

src/__tests__/step-executor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ describe('StepExecutor', () => {
144144
systemPrompt: 'system prompt',
145145
userInstruction: expect.stringContaining('Return exactly one fenced JSON block'),
146146
},
147-
undefined,
147+
'implement:3:1:1',
148148
3,
149149
);
150150
expect(onPhaseStart).not.toHaveBeenCalledWith(

src/core/workflow/report-phase-runner.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ export async function runReportPhase(
183183
log.debug('Report phase complete', { step: step.name, filesGenerated: reportFiles.length });
184184
}
185185

186-
function nextReportPhaseExecutionId(stepName: string, iteration: number | undefined, sequence: number): string {
186+
function nextReportPhaseExecutionId(stepName: string, iteration: number | undefined, sequence: number): string | undefined {
187187
if (iteration == null) {
188-
throw new Error(`Missing iteration for report phase execution id: ${stepName}`);
188+
return undefined;
189189
}
190190
return buildPhaseExecutionId({
191191
step: stepName,
@@ -213,7 +213,7 @@ async function runSingleReportAttempt(
213213
instruction: string,
214214
options: RunAgentOptions,
215215
ctx: PhaseRunnerContext,
216-
phaseExecutionId: string,
216+
phaseExecutionId: string | undefined,
217217
): Promise<ReportAttemptResult> {
218218
let didEmitPhaseStart = false;
219219
let resolvedPromptParts: PhasePromptParts | undefined;

0 commit comments

Comments
 (0)