Skip to content

Commit 2c45678

Browse files
committed
Throw an error (which is caught) if agent input is no longer live
1 parent 6b89abe commit 2c45678

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

backend/src/run-agent-step.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,18 @@ export const loopAgentSteps = async (
563563
while (true) {
564564
totalSteps++
565565
if (!checkLiveUserInput(userId, userInputId, clientSessionId)) {
566-
break
566+
logger.debug(
567+
{
568+
userId,
569+
userInputId,
570+
clientSessionId,
571+
totalSteps,
572+
runId,
573+
agentState,
574+
},
575+
'User input no longer live (likely cancelled)',
576+
)
577+
throw new Error('User input no longer live (likely cancelled)')
567578
}
568579

569580
const startTime = new Date()

0 commit comments

Comments
 (0)