Skip to content

Commit b9dc603

Browse files
committed
fix(hitl): stop duplicating input fields across listed pause points
1 parent 6ff0179 commit b9dc603

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

‎apps/sim/lib/workflows/executor/human-in-the-loop-manager.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3624,12 +3624,13 @@ export class PauseResumeManager {
36243624
entry.contextId === contextId && (entry.status === 'claimed' || entry.status === 'pending')
36253625
)
36263626

3627-
// The selected pause point's full `response.data` and `display` are already
3628-
// returned via `pausePoint` below; strip both from `execution.pausePoints` so a
3629-
// large HITL display payload isn't duplicated in full within the same response.
3627+
// The selected pause point's full `response.data`, `display`, and `inputFields`
3628+
// are already returned via `pausePoint` below; strip them from
3629+
// `execution.pausePoints` so a large HITL payload isn't duplicated in full
3630+
// within the same response.
36303631
const execution: PausedExecutionDetail = {
36313632
...detail,
3632-
pausePoints: detail.pausePoints.map(({ display, ...point }) =>
3633+
pausePoints: detail.pausePoints.map(({ display, inputFields, ...point }) =>
36333634
point.response ? { ...point, response: { ...point.response, data: undefined } } : point
36343635
),
36353636
}

‎apps/sim/lib/workflows/executor/pause-persistence.integration.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ describe('readPausedRunPoints', () => {
445445
}
446446
})
447447

448-
it('returns the selected point display once, not again in every listed point', async () => {
448+
it('returns the selected point display and input fields once, not again in every listed point', async () => {
449449
const registry = registryWithResolvedSecret()
450450
const executionId = await publishPausedRun([
451451
humanBranchPoint(0, registry),
@@ -461,9 +461,11 @@ describe('readPausedRunPoints', () => {
461461
expect(detail?.pausePoint.display).toEqual({
462462
responseStructure: [{ name: 'summary', type: 'string', value: 'Token is {{API_KEY}}' }],
463463
})
464+
expect(detail?.pausePoint.inputFields).toHaveLength(1)
464465
expect(detail?.execution.pausePoints).toHaveLength(2)
465466
for (const point of detail?.execution.pausePoints ?? []) {
466467
expect(point).not.toHaveProperty('display')
468+
expect(point).not.toHaveProperty('inputFields')
467469
}
468470
})
469471

0 commit comments

Comments
 (0)