fix(look-at): avoid empty stable idle completion

This commit is contained in:
YeonGyu-Kim
2026-05-21 12:54:56 +09:00
parent 6e6f300c7d
commit bd55396266
3 changed files with 20 additions and 1 deletions
@@ -61,6 +61,7 @@ Original error: ${createResult.error}`
log(`[look_at] Created session: ${sessionID}`)
log(`[look_at] Sending prompt with ${isBase64Input ? "base64 image" : "file"} to session ${sessionID}`)
let promptFailed = false
try {
await promptSyncWithModelSuggestionRetry(ctx.client, {
path: { id: sessionID },
@@ -83,6 +84,7 @@ Original error: ${createResult.error}`
queueBehavior: "defer",
})
} catch (promptError) {
promptFailed = true
log("[look_at] Prompt error (ignored, will still fetch messages):", promptError)
}
@@ -91,6 +93,7 @@ Original error: ${createResult.error}`
if (typeof ctx.client.session.status === "function") {
const waitResult = await waitForLookAtSessionResult(ctx.client, sessionID, {
allowStableIdleWithoutActivity: true,
allowEmptyStableIdleWithoutActivity: promptFailed,
})
observedText = waitResult.outcome.text ?? undefined
if (observedText) {