← Back to Pull requests

fix(browser,webview,webworker): module frame for handled reports of a failed dynamic import (BWD-38) #240

Closed
unknown closed this pull request without merging on Nov 29, 2026 18:10 UTC
View on GitHub
unknown unknown commented on Nov 28, 2026 08:30 UTC
Author

Problem


BWD-38: a failed dynamic import() reported through client.logException (e.g. a framework adapter's error boundary) shipped frames: [] and showed as "Handled TypeError at Unknown location". The stackless-context enricher from #218 was wired only into the window error/unhandledrejection providers, not into the clients. @bugsee/webview and @bugsee/webworker build their own client and had the same gap.

Fix


  • New createBrowserFrameEnricher(asyncOrigin?) in @bugsee/browser: the single definition of the browser-engine enricher order (async-origin call site first, then the stackless context for what is still empty).

  • Used by the browser client, the detection providers (replacing their inline composition), @bugsee/webview and @bugsee/webworker. The Electron renderer launches through @bugsee/browser, so it is covered.
  • Result


    crash.json carries one import() frame whose file is the failed module, so the location is the chunk and occurrences group together. The importer's call site is not recoverable (browsers don't expose it). The description lines (recent scripts, page, online) remain window-handler-only.

    Not changed (audited)


  • Node: failed imports are real Errors with frames (all node:internal) and the module/importer in the message.

  • Bun: failed imports are frameless (ResolveMessage/BuildMessage) but the message names module and importer. Separate follow-up, needs its own parser.

  • vercel-edge / cloudflare: not wired; the matchers target browser messages and Resource Timing.
  • Verification


  • Tests written first; they failed (frames: []) before the wiring. New: browser logException (+ async-origin off), webview, webworker, and the shared helper's ordering.

  • Mutations (swap order, drop origin, drop stackless, unwire each client) are all caught by tests.

  • browser 1424, webview 423, webworker 161, electron 648, umbrella 285 tests pass; 100% line coverage; typecheck (101 packages), lint, cycles clean.

  • Convergent multi-agent review not yet run.
  • 🤖 Generated with Claude Code

    https://claude.ai/code/session_01WeiJxRnbk1iC7HPhhoC2Cr

    Diff: 272 lines (+204 / -68) across 3 files Reviewer: krassx Review duration: 2019m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 272 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.336
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #240"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.5% (MEDIUM) · Higher = larger blast radius
    39.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.6% · Safe to merge
    15.6%