Async Action Support: Convert Node internal functions with async/await#657
Async Action Support: Convert Node internal functions with async/await#657nasif-z wants to merge 44 commits into
async/await#657Conversation
async/await
|
@claude Review the changes and suggest additional improvements - specially in regards to if something was missed with async/await. |
Partial match was not picking up action named "validate partial text"
05970f0 to
1f0e02d
Compare
Removes threading and uses async instead for `Thread_ScreenShot`
Similar to Selenium open browser action
…lenium-dual-driver [Req-81] Playwright-Selenium Dual-Driver Implementation
Add shared browser session utilities for normalized session parsing, safe registry access, session removal, and available CDP port allocation. Wire Selenium and Playwright actions through a pre-action session activator so actions with an explicit session parameter run against the requested browser instead of whichever global driver was last active. Missing explicit sessions now fail for non-creation actions. Keep Selenium and Playwright session registries in sync across open, switch, and teardown paths. Store CDP metadata in browser_sessions, clean up paired CDP resources, and preserve non-targeted sessions during framework-specific teardown. Make Playwright frame state session-aware, fix several Playwright actions that were calling async APIs synchronously, collect browser logs across session Selenium drivers, and make screenshots prefer the active Playwright page when appropriate. Add focused browser session unit tests for session activation, missing-session failure, and session registry removal.
…ssions [Task-2247] Named Browser Sessions For Dual-Driver Browser Instances
🔎 ZeuZ PR ReviewOpen the full report in ZeuZ: Review findings and apply suggestions
Agent breakdown→ General ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe237edae9120ba-IAD, request id: req_efa80c35f80548e287c43404fa21011e → Security ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe237ec59458a7d-IAD, request id: req_e7bc6115793a4fb08308fc2592b55220 → Performance ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe237ec8b4698e4-IAD, request id: req_c03a5dfa02434249a846406619c3c559 → Testing ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe237edba9a4f8b-IAD, request id: req_93b41cd2376741c29e760b3902d32360
|
🔎 ZeuZ PR ReviewOpen the full report in ZeuZ: Review findings and apply suggestions
Agent breakdown→ General ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe23ee1a9fbb4ba-IAD, request id: req_afc05401a0a44101bbca1098a863a5c6 → Security ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe23ee08bdce643-IAD, request id: req_321b63cd3ea946e0b2d173756201b0fd → Performance ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe23ee18e0f0829-IAD, request id: req_5468cafca8a544fbaf6aca722e1a4682 → Testing ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe23edf9a295764-IAD, request id: req_09f2617be49e4ae9bbec7ff96c24349b
|
Run Playwright teardown before Selenium during driver cleanup so Playwright-owned sessions close their async browser resources first. Teach Selenium global teardown to skip sessions that are owned by Playwright, while still allowing Selenium-owned sessions with Playwright bridges to be cleaned up. Add a regression test covering Playwright-owned sessions with Selenium CDP bridges so Selenium teardown does not close or remove them.
🔎 ZeuZ PR ReviewOpen the full report in ZeuZ: Review findings and apply suggestions
Agent breakdown→ General ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe300c33da5fc33-IAD, request id: req_4280a832f3a648139c8338d9f4f14b9e → Security ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe300c2af85ae0c-IAD, request id: req_eae8425f71ba414999888fa90528b84d → Performance ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe300c2eafed680-IAD, request id: req_66f0c9e11db44596adc47ad4a20de9b3 → Testing ReviewStatus: ⏳ Reviewing Current status: reviewing.
|
Treat index rows in Playwright switch_iframe as iframe/frame indexes instead of generic element attributes. This prevents index iframe parameters from producing invalid selectors such as [index='1']. Allow a default-content reset and a subsequent iframe target in the same action, matching the Selenium action behavior used by existing test data. Build indexed frame locators with frame_locator(tag).nth(index), preserve selector-based iframe targets, and save the resulting frame locator back to the active browser session. Add regression coverage for switching to default content and then selecting iframe index 1 with a Playwright action.
🔎 ZeuZ PR ReviewOpen the full report in ZeuZ: Review findings and apply suggestions
Agent breakdown→ General ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe37f2eba91576d-IAD, request id: req_6879152d08754483831ae09717478a89 → Security ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe37f30ae3f37c5-IAD, request id: req_45a7c6c2e9204c72825d483dc6dd0d3b → Performance ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe37f3139e6a13a-IAD, request id: req_d084e14d0fd44bed97d05bde335be580 → Testing ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9fe37f2d8f4d1734-IAD, request id: req_1d7e27c585444396b7f5e03c370b0441
|
…d Chromium installation method
🔎 ZeuZ PR ReviewOpen the full report in ZeuZ: Review findings and apply suggestions
Agent breakdown→ General ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9feafde92d0d2959-IAD, request id: req_2a226ff031b7460eb195cb938bfcba12 → Security ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9feafde91b697100-IAD, request id: req_81d6d325a751411fbee441eb40135489 → Performance ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9feafdea683fc9fe-IAD, request id: req_2cf11bb2d9584cff88baf8a334c84144 → Testing ReviewStatus: ❌ Failed unexpected status 401 Unauthorized: Incorrect API key provided: sk-proj-********************************************DpoS. You can find your API key at https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: 9feafdec4f0e5e59-IAD, request id: req_cc10e6e8f9e74d39b36e387d72170cc6
|
- Defaults to viewport instead of full page - Default image quality is now 70% - Skips `PIL` post-processing for Playwright
🔎 ZeuZ PR ReviewOpen the full report in ZeuZ: Review findings and apply suggestions
Agent breakdown→ General ReviewStatus: ✅ Completed The async conversion introduces two high-severity regressions: one loop helper still calls → Security ReviewStatus: ✅ Completed No security-relevant issues were introduced by this async Playwright refactor in the reviewed diff. → Performance ReviewStatus: ✅ Completed I found one meaningful performance risk: the new Playwright startup path now also launches a Selenium ChromeDriver for every browser session, which adds extra process startup and duplicate browser-control overhead on the hot path. → Testing ReviewStatus: ✅ Completed The PR adds substantial async Playwright/session-routing behavior, but I don’t see corresponding tests covering the new control flow or regression points.
|
Avoid starting Playwright during Selenium browser launches and avoid creating Selenium CDP drivers during Playwright launches. Store session metadata with the remote debugging port and attach the opposite framework only when an action from that framework targets the session.
🔎 ZeuZ PR ReviewOpen the full report in ZeuZ: Review findings and apply suggestions
Agent breakdown→ General ReviewStatus: ✅ Completed The async conversion is a good direction, but a few synchronous call sites were left behind and will now return coroutine objects instead of running browser actions. There is also a risky default behavior change in Playwright browser startup. → Security ReviewStatus: ✅ Completed No clear security regressions are introduced in the provided PR diff. The changes primarily refactor execution to async/await and add Playwright session routing without exposing a direct injection, auth, or secret-handling issue visible in the diff. → Performance ReviewStatus: ✅ Completed No performance regressions or scalability issues stood out in this PR diff. The changes are mostly async plumbing plus Playwright session routing, with no clear N+1, unbounded query, or memory-growth concerns visible from the code provided. → Testing ReviewStatus: ✅ Completed The PR adds substantial async/session-routing behavior in the browser automation path, but the test suite only covers a small slice of the new Playwright session helpers. The highest-risk regressions are currently unprotected by tests.
|
Experimental
This PR is currently meant for experimenting with Playwright Web actions in order to compare its performance with Selenium.
dev.Fixed bugs
Fixed a few bugs in the initial Claude-generated code for Playwright web actions, such as:
Tested Actions/Functions
Note
Need to write
playwright actionin the action name instead ofselenium action.Test Cases used for debugging: