mirror of https://github.com/garrytan/gstack.git
When handing off from headless to headed mode, old pages were removed from
the pages map without being explicitly closed. This left Playwright Page
objects dangling with their event listeners and resources intact, causing
a resource leak.
The pattern for cleanup should match closeAllPages() and recreateContext(),
which both explicitly close pages before clearing the map:
for (const page of this.pages.values()) {
await page.close().catch(() => {});
}
this.pages.clear();
This ensures Playwright resources are properly released when switching to
headed mode, preventing memory accumulation on repeated handoff/resume cycles.
Fixes resource leak in interactive handoff workflow (headless → headed mode).
|
||
|---|---|---|
| .. | ||
| bin | ||
| scripts | ||
| src | ||
| test | ||
| SKILL.md | ||
| SKILL.md.tmpl | ||