Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore(debug): log auth state diagnostics on sign-in timeout

Steven Enamakelb26ccb14a7c0
diff --git a/scripts/debug/web-ui.mjs b/scripts/debug/web-ui.mjs
index a3029a49c3..574b49e2d1 100644
--- a/scripts/debug/web-ui.mjs
+++ b/scripts/debug/web-ui.mjs
@@ -157,13 +157,30 @@ async function signIn(page, rpc, appOrigin) {
await page.getByText("Welcome to OpenHuman").waitFor({ timeout: 120_000 });
log("signing in through the GitHub provider button (mock backend)…");
await page.getByRole("button", { name: "GitHub" }).click();
- await waitFor(
- async () => (await rpc("openhuman.auth_get_state")).isAuthenticated,
- {
- timeoutMs: 120_000,
- what: "the core's authenticated state after mock sign-in",
- },
- );
+ let lastAuthState;
+ try {
+ await waitFor(
+ async () => {
+ lastAuthState = await rpc("openhuman.auth_get_state");
+ return lastAuthState.isAuthenticated;
+ },
+ {
+ timeoutMs: 120_000,
+ what: "the core's authenticated state after mock sign-in",
+ },
+ );
+ } catch (error) {
+ const nested = lastAuthState?.result;
+ log(
+ `auth state diagnostic: ${JSON.stringify({
+ response_keys: Object.keys(lastAuthState ?? {}),
+ direct_is_authenticated: lastAuthState?.isAuthenticated === true,
+ result_keys: Object.keys(nested ?? {}),
+ nested_is_authenticated: nested?.isAuthenticated === true,
+ })}`,
+ );
+ throw error;
+ }
await ensureSignedInChat(page, appOrigin);
}