Skip to content

fix: preserve primitive exception messages - #437

Open
ch-z-hc wants to merge 2 commits into
Tencent:mainfrom
ch-z-hc:fix/console-primitive-exceptions
Open

ch-z-hc wants to merge 2 commits into
Tencent:mainfrom
ch-z-hc:fix/console-primitive-exceptions

Conversation

@ch-z-hc

@ch-z-hc ch-z-hc commented Oct 13, 2026 •

Copy link
Copy Markdown

Bug

For throw "connection token expired", both bsk console and bsk evaluate report only Uncaught and lose the actual reason. Chrome sends that reason in exception.value, not exception.description. The same loss affects thrown booleans and null.

Real isolated Chrome captures confirm both the Runtime.exceptionThrown events and Runtime.evaluate exception replies. Regression tests feed those shapes through the actual handlers: five console cases and three evaluate cases fail on their original implementations; numeric-description controls already pass.

Fix

For console, reuse the existing remoteObjectToText() conversion before extracting the first line (one product line). For evaluate, move its existing value fallback ahead of the generic header. No new serializer or abstraction. Existing Error descriptions, fallback when the value is absent, stack/location handling, truncation and buffering remain unchanged.

Six console cases cover strings, multiline strings, zero, false, null and undefined. Four evaluate cases cover strings, false, null and the numeric-description control. The evaluate regressions were added as a follow-up to this same exception-message fix.

Validation

  • Related CDP/console/evaluate tests: 80 passed.
  • Complete default extension selection with vitest run --maxWorkers=2: 2592 passed, 233 existing conditional skips after the evaluate follow-up. No assertions, timeouts or skip conditions were changed.
  • Extension typecheck and production build, repository Biome (626 files), Stylelint and DSH typecheck pass.
  • Earlier DSH validation: 492 passed, 2 failed in existing kill-grace runner tests. Unchanged main reproduced the same two failures (28 passed in that file). This suite was not rerun for the evaluate-only follow-up; DSH typecheck was rerun and passes.
  • Earlier runs at default worker concurrency were not green: 3 and 4 existing heavy-test timeouts respectively (screenshot exports, PNG encoding, URL-regex child process, and in the second run canvas ancestry). The full two-worker runs pass, but the underlying cause of those timeouts is not established here.

The Chrome capture verifies browser event payloads, not an installed-extension/CLI end-to-end session. Rust and opt-in browser suites were not run. Implemented and tested with Codex assistance; no independent human review is claimed.

@ch-z-hc ch-z-hc changed the title fix(console): preserve primitive exception messages fix: preserve primitive exception messages Oct 13, 2026
@iuyo5678

Copy link
Copy Markdown
Collaborator

The PR is still in draft status, cannot be merged

@ch-z-hc
ch-z-hc marked this pull request as ready for review October 14, 2026 08:17
@ch-z-hc

ch-z-hc commented Oct 16, 2026

Copy link
Copy Markdown
Author

This PR is now marked ready for review. The current CI run is awaiting maintainer approval. Could you approve the run when you have a chance?

The same CI approval is pending for #435, #436, #451 and #453.

This branch has not been deployed

No deployments
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.

2 participants