fix(qa): accept completed mock image turns

This commit is contained in:
Vincent Koc
2026-06-10 17:48:33 +09:00
parent 87abb8defb
commit 2c146261a2

View File

@@ -138,15 +138,28 @@ steps:
value: ""
- set: imageReplyText
value: ""
- call: runAgentPrompt
args:
- ref: env
- sessionKey:
ref: sessionKey
message:
expr: config.imagePrompt
timeoutMs:
expr: liveTurnTimeoutMs(env, config.imageTurnTimeoutMs)
- set: imageReplyStartIndex
value:
expr: "state.getSnapshot().messages.filter((message) => message.direction === 'outbound').length"
- try:
actions:
- call: runAgentPrompt
args:
- ref: env
- sessionKey:
ref: sessionKey
message:
expr: config.imagePrompt
timeoutMs:
expr: liveTurnTimeoutMs(env, config.imageTurnTimeoutMs)
catchAs: imageRunError
catch:
- if:
expr: "!env.mock || !/agent run aborted/i.test(formatErrorMessage(imageRunError))"
then:
- throw:
message:
expr: "formatErrorMessage(imageRunError)"
- try:
actions:
- call: resolveGeneratedImagePath
@@ -174,6 +187,8 @@ steps:
params: [candidate]
expr: "candidate.conversation.id === 'qa-operator' && (String(candidate.text ?? '').includes('MEDIA:') || /media failed|image generation failed/i.test(String(candidate.text ?? '')))"
- expr: liveTurnTimeoutMs(env, config.imageTurnTimeoutMs)
- sinceIndex:
ref: imageReplyStartIndex
- set: imageReplyText
value:
expr: "String(imageReply.text ?? '')"