Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(doctor): google_oauth no longer calls an unprobed refresh token healthy (#5012)

garrytanb52fbd93971c
diff --git a/src/commands/doctor/checks/google-oauth.ts b/src/commands/doctor/checks/google-oauth.ts
index 90c86167ab..2c52d9dacf 100644
--- a/src/commands/doctor/checks/google-oauth.ts
+++ b/src/commands/doctor/checks/google-oauth.ts
@@ -66,7 +66,10 @@ export async function computeGoogleOauthCheck(): Promise<Check> {
return {
name: 'google_oauth',
status: 'ok',
- message: `${metas.length} Google account(s) connected, refresh healthy`,
+ // #5012: doctor never probes the network, so it cannot call a refresh token healthy;
+ // a token revoked since the last successful refresh shows only on a live probe.
+ message: `${metas.length} Google account(s) connected, recent refreshes succeeded (not probed online; ` +
+ '`gbrain google status` tests each refresh token)',
};
} catch (e) {
return {
diff --git a/test/google-oauth-doctor.test.ts b/test/google-oauth-doctor.test.ts
index 6db0b6d3e6..892fbb9862 100644
--- a/test/google-oauth-doctor.test.ts
+++ b/test/google-oauth-doctor.test.ts
@@ -91,7 +91,8 @@ describe('computeGoogleOauthCheck', () => {
const r = await computeGoogleOauthCheck();
expect(r.status).toBe('ok');
expect(r.message).toContain('1 Google account(s) connected');
- expect(r.message).toContain('refresh healthy');
+ expect(r.message).toContain('not probed online');
+ expect(r.message).not.toContain('refresh healthy');
});
});
@@ -129,7 +130,8 @@ describe('computeGoogleOauthCheck', () => {
await withEnv({ GBRAIN_HOME: home }, async () => {
const r = await computeGoogleOauthCheck();
expect(r.status).toBe('ok');
- expect(r.message).toContain('refresh healthy');
+ expect(r.message).toContain('not probed online');
+ expect(r.message).not.toContain('refresh healthy');
});
});