Compare commits

...

3 Commits

Author SHA1 Message Date
Siddharth Ganesan
e4835817ee Reset 2026-01-24 02:16:52 -08:00
Siddharth Ganesan
8a0156a578 Fix lint 2026-01-24 02:15:09 -08:00
Siddharth Ganesan
ad7fb6e575 Fix hitl 2026-01-24 02:14:46 -08:00
2 changed files with 39 additions and 1 deletions

View File

@@ -85,7 +85,11 @@ export class ConditionBlockHandler implements BlockHandler {
const sourceBlockId = ctx.workflow?.connections.find((conn) => conn.target === block.id)?.source const sourceBlockId = ctx.workflow?.connections.find((conn) => conn.target === block.id)?.source
const evalContext = this.buildEvaluationContext(ctx, sourceBlockId) const evalContext = this.buildEvaluationContext(ctx, sourceBlockId)
const sourceOutput = sourceBlockId ? ctx.blockStates.get(sourceBlockId)?.output : null const rawSourceOutput = sourceBlockId ? ctx.blockStates.get(sourceBlockId)?.output : null
// Filter out _pauseMetadata from source output to prevent the engine from
// thinking this block is pausing (it was already resumed by the HITL block)
const sourceOutput = this.filterPauseMetadata(rawSourceOutput)
const outgoingConnections = ctx.workflow?.connections.filter((conn) => conn.source === block.id) const outgoingConnections = ctx.workflow?.connections.filter((conn) => conn.source === block.id)
@@ -125,6 +129,14 @@ export class ConditionBlockHandler implements BlockHandler {
} }
} }
private filterPauseMetadata(output: any): any {
if (!output || typeof output !== 'object') {
return output
}
const { _pauseMetadata, ...rest } = output
return rest
}
private parseConditions(input: any): Array<{ id: string; title: string; value: string }> { private parseConditions(input: any): Array<{ id: string; title: string; value: string }> {
try { try {
const conditions = Array.isArray(input) ? input : JSON.parse(input || '[]') const conditions = Array.isArray(input) ? input : JSON.parse(input || '[]')

View File

@@ -567,6 +567,32 @@ export class PauseResumeManager {
stateCopy.blockStates[stateBlockKey] = pauseBlockState stateCopy.blockStates[stateBlockKey] = pauseBlockState
// Update the block log entry with the merged output so logs show the submission data
if (Array.isArray(stateCopy.blockLogs)) {
const blockLogIndex = stateCopy.blockLogs.findIndex(
(log: { blockId: string }) =>
log.blockId === stateBlockKey ||
log.blockId === pauseBlockId ||
log.blockId === contextId
)
if (blockLogIndex !== -1) {
// Filter output for logging (exclude internal fields and response)
const filteredOutput: Record<string, unknown> = {}
for (const [key, value] of Object.entries(mergedOutput)) {
if (key.startsWith('_')) continue
if (key === 'response') continue
filteredOutput[key] = value
}
stateCopy.blockLogs[blockLogIndex] = {
...stateCopy.blockLogs[blockLogIndex],
blockId: stateBlockKey,
output: filteredOutput,
durationMs: pauseDurationMs,
endedAt: new Date().toISOString(),
}
}
}
if (Array.isArray(stateCopy.executedBlocks)) { if (Array.isArray(stateCopy.executedBlocks)) {
const filtered = stateCopy.executedBlocks.filter( const filtered = stateCopy.executedBlocks.filter(
(id: string) => id !== pauseBlockId && id !== contextId (id: string) => id !== pauseBlockId && id !== contextId