You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: contain async loggers and redact real preview tokens (#7)
Answers the GPT-5.6 Sol review of the error codes: safeLogger contains async-rejecting loggers and throwing getters; the exact preview token (a JWT) and its encoded forms are redacted from every message; the SDK cause is a redacted clone that keeps prototype, status, code and the nested cause chain; isConnected() is guarded. Opus verification pass plus one fix round.
Copy file name to clipboardExpand all lines: README.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -296,7 +296,11 @@ asked for anything yet. Everything after that is an `outcome`, never an
296
296
exception. What it throws is a `HandraiseError` with a `code`: the code is the
297
297
contract, the message is for whoever reads the log and may be reworded in any
298
298
release. `isHandraiseError` narrows a `catch` binding, and `cause` keeps the
299
-
original SDK, CDP or network error whenever there was one.
299
+
original SDK, CDP or network error whenever there was one — the same class,
300
+
`name`, `status` and `code`, its own non-enumerable properties, and its own
301
+
`cause` chain — with credentials redacted out of every `message`, `stack` and
302
+
response body along it. Every error serialiser prints the whole chain, so a
303
+
clean outer message on its own would not be worth much.
300
304
301
305
The first thing `raiseHand` does is look at your page, before it creates
302
306
anything: a page you have closed, or a browser you have disconnected, is
@@ -323,7 +327,7 @@ try {
323
327
|`invalid_mode`|`mode` is neither `"takeover"` nor `"approval"`. | Fix the call. TypeScript already refuses it; this is for JavaScript callers. |
324
328
|`empty_action`|`mode: "approval"` without a non-empty `action`. | Name the step the human says yes or no to. |
325
329
|`browser_unusable`| The page is closed, or its browser has disconnected — checked before anything is created. | Open a new page or relaunch the session (restore `storageState` if you kept it) and retry. |
326
-
|`relay_start_failed`| The relay sandbox could not be created or deployed. | Read `cause` — it is the Solari SDK's own error. Retry. Nothing is left behind unless you also see `relay_release_failed` (below). |
330
+
|`relay_start_failed`| The relay sandbox could not be created or deployed. | Read `cause` — it is the Solari SDK's own error, redacted. Retry. Nothing is left behind unless you also see `relay_release_failed` (below). |
327
331
|`concurrency_limit`| Your Solari account is at its concurrent session cap (429). | Free a session, or wait and retry. The one relay failure that is purely temporary. |
328
332
|`relay_not_ready`| The sandbox started but its public URL never answered. | Retry. Persisting means the preview proxy or the region is unhealthy. |
// A context with no browser is a persistent context: there is no session
649
+
// object to ask, and `isClosed()` above has already spoken for the page.
650
+
connected=browser?.isConnected()??true
642
651
}catch(cause){
643
652
thrownewHandraiseError(
644
653
"browser_unusable",
645
-
`handraise: this page cannot be handed to a human — reading its state (page.isClosed(), page.context()) threw. A dead CDP connection does that, and so does a page-like object that is not a Playwright page. ${String(cause)}`,
654
+
`handraise: this page cannot be handed to a human — reading its state (page.isClosed(), page.context().browser().isConnected()) threw. A dead CDP connection does that, and so does a page-like object that is not a Playwright page. ${String(cause)}`,
646
655
{ cause },
647
656
)
648
657
}
@@ -652,7 +661,7 @@ function checkedPage(page: Page): void {
652
661
"handraise: this page is already closed, so there is nothing for a human to take over. Open a new page (its `storageState` from an earlier handoff, if you kept it, restores the human's work) and retry.",
653
662
)
654
663
}
655
-
if(browser&&!browser.isConnected()){
664
+
if(!connected){
656
665
thrownewHandraiseError(
657
666
"browser_unusable",
658
667
"handraise: the browser session behind this page is already disconnected, so there is nothing for a human to take over. Relaunch the session (its `storageState` from an earlier handoff, if you kept it, restores the human's work) and retry.",
0 commit comments