-
handoffcards always have a Done button, and Done is how the agent resumes:handoffdrops themanualoption andwaitForHandoffdropsuntil.waitForHandoffreturns when the user presses Done and throws when they close the card. It no longer polls the page, so check the page yourself after it returns.const { link } = await handoff({ page: state.page, message: 'Sign in to Discord with your own account.' }) // send the link in chat, then wait in a background execute with a long --timeout await waitForHandoff({ page: state.page }) // returns on Done, throws on close
Done and close both fade the card out right away, even when no
waitForHandoffis running, and the card no longer comes back after a navigation. AwaitForHandoffstarted after the click returns (Done) or throws (close) at once. The skill now tells agents to send the link first and wait only in the background, so the user always sees the link. -
Warning for long fixed waits, and faster scraping in the skill: execute prints a
[WARNING]whenwaitForTimeout()calls in one call add up to more than 3s, with the waits to use instead. The skill teaches waiting for text on unknown pages (page.waitForFunction,getByText(regex).waitFor()),Promise.all([page.waitForResponse(...), click()])around clicks, reading shop data from the site's own JSON (Shopify/cart.js, WooCommerce Store API), and running known flows in one call with parallel tabs.