mirror of
https://github.com/remorses/playwriter.git
synced 2026-09-14 16:37:40 +08:00
adc7125b47
When a single-expression code snippet auto-returns a Playwright object (e.g. `await page.goto(url)` returning a Response), the CLI previously called util.inspect() at depth 4 on the handle, producing 400K+ chars that included every process.env variable (API keys, tokens, secrets). Even with the playwright-core util.inspect fix (@xmorse/playwright-core@1.59.7), these handles are useless output — they're programmatic references with no display value. Agents and users get nothing meaningful from seeing: [return value] Response@response@abc123 { request: Channel<...>, ... } Fix: add isPlaywrightChannelOwner() duck-type check in the executor return value path. Handles are silently skipped (duck: _type + _guid + _connection). The existing 'Code executed successfully (no output)' fallback applies when there's no other output. To see data, users must explicitly: return response.url() → prints the URL string return response.status() → prints 200 console.log(response) → prints safe summary via playwright-core Also includes: - Regression test (channel-owner-inspect.test.ts) for inspect handler - isPlaywrightChannelOwner() unit tests (executor.unit.test.ts) - Stale color-scheme snapshot fix (relay-core.test.ts) - MEMORY.md with learnings (Node util.inspect bypass of Proxy traps)