Skip to content

fix: allow browser:false commands to run without page after lazy-load#345

Closed
jackwener wants to merge 2 commits intomainfrom
fix/ci-e2e-public-commands
Closed

fix: allow browser:false commands to run without page after lazy-load#345
jackwener wants to merge 2 commits intomainfrom
fix/ci-e2e-public-commands

Conversation

@jackwener
Copy link
Owner

Summary

  • The C2 fix in PR fix: resolve 6 critical bugs from deep code review (round 2) #337 added a null-page guard in execution.ts after lazy-loading TS modules, but it threw unconditionally — breaking all browser: false commands (bloomberg, apple-podcasts, google, yollomi, weread, xiaoyuzhou) that call func() with a null page
  • This caused 23 E2E test failures in public-commands.test.ts on CI
  • Fix: guard now checks updated.browser !== false before throwing

Root cause

Line 102 in execution.ts was:

if (!page) throw new CommandExecutionError(...)

Should be:

if (!page && updated.browser !== false) throw new CommandExecutionError(...)

Test plan

  • npm run typecheck — clean
  • npm test — 223 tests pass
  • Manual verification: bloomberg main, bloomberg feeds, yollomi models, apple-podcasts search all return data correctly
  • Commands that require browser still get the guard when page is null

🤖 Generated with Claude Code

jackwener and others added 2 commits March 24, 2026 15:02
- R1: Extract isRecord() type guard to shared src/utils.ts (8 files)
- R2: Merge duplicate mapConcurrent() to shared utils (fetch.ts + download.ts)
- R3: Extract saveBase64ToFile() helper (cdp.ts + page.ts)
- R4: Merge _tabOpt() + _workspaceOpt() into _cmdOpts()/_wsOpt() (page.ts)
- R5: Extract normalizeRows() + resolveColumns() in output.ts
- R6: Remove dead register stub from generate.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the apple-podcasts top command times out on CI, the child process
is killed with empty stderr. The existing guard didn't catch this case,
causing a flaky E2E failure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jackwener jackwener force-pushed the fix/ci-e2e-public-commands branch from 7bf5ba4 to 9e783d3 Compare March 24, 2026 07:03
@jackwener jackwener closed this Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant