{"record":{"id":"972578cfa3530385","repo":"openclaw/openclaw","slug":"no-dialog-is-pending","errorCode":null,"errorMessage":"No dialog is pending.","messagePattern":"No dialog is pending\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"extensions/browser/src/browser/pw-session-dialogs.ts","lineNumber":166,"sourceCode":"export function resolvePendingDialogForResponse(params: {\n  state: PageState;\n  dialogId?: string;\n}): PendingObservedDialog {\n  const dialogId = normalizeOptionalString(params.dialogId);\n  if (dialogId) {\n    const found = params.state.pendingDialogs.find((dialog) => dialog.id === dialogId);\n    if (found) {\n      return found;\n    }\n    throw new Error(`Dialog \"${dialogId}\" is not pending.`);\n  }\n  if (params.state.pendingDialogs.length === 1) {\n    return expectDefined(params.state.pendingDialogs.at(0), \"single pending browser dialog\");\n  }\n  if (params.state.pendingDialogs.length > 1) {\n    throw new Error(\"Multiple dialogs are pending; pass dialogId.\");\n  }\n  throw new Error(\"No dialog is pending.\");\n}\n\n/** Respond to a pending observed dialog on a page. */\n","sourceCodeStart":148,"sourceCodeEnd":170,"githubUrl":"https://github.com/openclaw/openclaw/blob/01804a75319da4b69c9ab98ceaa30477e22b8c0b/extensions/browser/src/browser/pw-session-dialogs.ts#L148-L170","documentation":"Thrown by resolvePendingDialogForResponse (extensions/browser/src/browser/pw-session-dialogs.ts:166) when state.pendingDialogs is empty. The caller attempted to respond to a dialog that does not exist on the page.","triggerScenarios":"Calling respond when no JS dialog is open; the dialog already completed before the respond arrived; responding to a dialog that was observed on a different page/target than the one being acted on.","commonSituations":"Operator/agent assumed a dialog would be triggered but the triggering action did not produce one; the dialog was auto-dismissed by an armed response; cross-target confusion (dialog is pending on tab A, respond targeted tab B).","solutions":["Trigger the action that produces the dialog (click the button that opens it) before responding.","Re-snapshot state and only respond when pendingDialogs.length > 0.","Verify you are operating on the same targetId where the dialog is actually pending."],"exampleFix":"// before: respond with no dialog present\nawait respondDialog({ accept: true });\n\n// after: guard on live state\nconst { pendingDialogs } = await snapshot(state);\nif (pendingDialogs.length === 0) {\n  // trigger the dialog-producing action first, then respond\n  await act({ kind: \"click\", ref: openDialogRef });\n}\nawait respondDialog({ accept: true });","handlingStrategy":"validation","validationCode":"const { pendingDialogs } = await snapshotPageState(page);\nif (pendingDialogs.length === 0) {\n  // nothing to do; either the dialog already completed or never fired\n  return { ok: true, noDialog: true };\n}\nawait respondDialog({ accept });","typeGuard":"function hasPendingDialog(state): boolean {\n  return state.pendingDialogs.length > 0;\n}","tryCatchPattern":"try {\n  await respondDialog({ accept: true });\n} catch (err) {\n  if (err.message === \"No dialog is pending.\") return;\n  throw err;\n}","preventionTips":["Trigger the dialog-producing action before issuing a respond.","Verify you are operating on the targetId where the dialog is actually pending.","Treat 'no dialog pending' as a benign no-op in idempotent flows."],"tags":["browser","dialog","no-op","validation"],"backgroundTag":null,"analyzedSha":"01804a75319da4b69c9ab98ceaa30477e22b8c0b","analyzedAt":"2026-08-12T04:37:58.197Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}