Repository navigation
fix(google-meet): fall back to manual OAuth paste when callback port is occupied - #96492
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 12:36 PM ET / 16:36 UTC. Summary PR surface: Source +32, Tests +66. Total +98 across 2 files. Reproducibility: yes. at source/proof level. Current main directly awaits the fixed localhost:8085 listener, the shared helper rejects listener errors, and the PR body includes before/after live output with port 8085 occupied. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this plugin-local fallback after exact-head CI completes, while leaving the broader Google OAuth client_secret policy decision in the linked issue. Do we have a high-confidence way to reproduce the issue? Yes at source/proof level. Current main directly awaits the fixed localhost:8085 listener, the shared helper rejects listener errors, and the PR body includes before/after live output with port 8085 occupied. Is this the best way to solve the issue? Yes. Reusing the existing manual paste flow inside the Google Meet plugin mirrors the sibling Google OAuth behavior without changing config, registered redirect URI, or token exchange policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f29dbd3ebd1c. Label changesLabel justifications:
Evidence reviewedPR surface: Source +32, Tests +66. Total +98 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
…is occupied The Google Meet OAuth login binds a fixed localhost:8085 callback listener and let listener failures propagate, so meet auth login aborted entirely when port 8085 was already in use. The sibling Gemini CLI OAuth path already recovers by switching to the manual copy/paste flow on EADDRINUSE/listen errors; bring Google Meet to parity by catching listener errors and reusing the existing manual-paste handler instead of failing the login.
1904fd0 to
4891649
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
…is occupied (openclaw#96492) The Google Meet OAuth login binds a fixed localhost:8085 callback listener and let listener failures propagate, so meet auth login aborted entirely when port 8085 was already in use. The sibling Gemini CLI OAuth path already recovers by switching to the manual copy/paste flow on EADDRINUSE/listen errors; bring Google Meet to parity by catching listener errors and reusing the existing manual-paste handler instead of failing the login.
…is occupied (openclaw#96492) The Google Meet OAuth login binds a fixed localhost:8085 callback listener and let listener failures propagate, so meet auth login aborted entirely when port 8085 was already in use. The sibling Gemini CLI OAuth path already recovers by switching to the manual copy/paste flow on EADDRINUSE/listen errors; bring Google Meet to parity by catching listener errors and reusing the existing manual-paste handler instead of failing the login.
…is occupied (openclaw#96492) The Google Meet OAuth login binds a fixed localhost:8085 callback listener and let listener failures propagate, so meet auth login aborted entirely when port 8085 was already in use. The sibling Gemini CLI OAuth path already recovers by switching to the manual copy/paste flow on EADDRINUSE/listen errors; bring Google Meet to parity by catching listener errors and reusing the existing manual-paste handler instead of failing the login. (cherry picked from commit 38ab207)
…is occupied (openclaw#96492) The Google Meet OAuth login binds a fixed localhost:8085 callback listener and let listener failures propagate, so meet auth login aborted entirely when port 8085 was already in use. The sibling Gemini CLI OAuth path already recovers by switching to the manual copy/paste flow on EADDRINUSE/listen errors; bring Google Meet to parity by catching listener errors and reusing the existing manual-paste handler instead of failing the login. (cherry picked from commit 38ab207)
…is occupied (openclaw#96492) The Google Meet OAuth login binds a fixed localhost:8085 callback listener and let listener failures propagate, so meet auth login aborted entirely when port 8085 was already in use. The sibling Gemini CLI OAuth path already recovers by switching to the manual copy/paste flow on EADDRINUSE/listen errors; bring Google Meet to parity by catching listener errors and reusing the existing manual-paste handler instead of failing the login. (cherry picked from commit 38ab207)
What Problem This Solves
Fixes the second half of #54299. The Google Meet OAuth login (
openclaw meet auth login) binds a temporary callback listener on a fixedlocalhost:8085. When that port is already taken by another local service, the listener throwsEADDRINUSEand the error propagates straight out ofwaitForGoogleMeetAuthCode, aborting the whole login. The user cannot complete OAuth at all until they free the port.The sibling Gemini CLI OAuth path already handles this exact case: it catches listener/port errors and switches to the manual copy/paste flow so login still succeeds. Google Meet was the one-sided gap.
Why This Change Was Made
extensions/google-meet/src/oauth.tshad no recovery around the local listener:waitForLocalOAuthCallbackrejects through itsserver.once("error", ...)handler whenserver.listen(8085)fails, so an occupied port becomes a hard login failure.The fix mirrors the Gemini path in
extensions/google/oauth.ts(err.message.includes("EADDRINUSE") || "port" || "listen"). On a listener/port error it now writes a notice and falls back to the manual paste handler, which is the same code already used for the explicit--manualflag:The pre-existing manual-paste branch was extracted into
readManualGoogleMeetAuthCodeso the explicit--manualpath and the automatic fallback share one implementation.This change deliberately does not touch the conditional
client_secrethandling raised in the first half of #54299. That is the Gemini public-client PKCE contract and a maintainer product decision (ClawSweeper labeled itneeds-product-decision/needs-security-review), not a defect to silently flip here.Why This Is The Right Boundary
The fix lives in the Google Meet plugin that owns this OAuth flow, reuses the existing manual handler rather than adding a second paste implementation, and does not change the registered redirect URI or port (changing those would require coordinated provider registration and docs, a separate product decision). It only matches the Gemini sibling's already-shipped recovery behavior. Non-listener failures (timeout, state mismatch, OAuth error) still propagate unchanged, so a genuine auth failure is never masked as a manual prompt.
User Impact
openclaw meet auth loginnow completes via the manual copy/paste flow when port 8085 is occupied, instead of aborting withEADDRINUSE. No new config or env var; behavior with a free port is unchanged.Verification
node scripts/run-vitest.mjs extensions/google-meet/src/oauth.test.tspasses (8 tests). The new test fails on pristineorigin/mainwithlisten EADDRINUSE: address already in useand passes with the patch.oxlintandoxfmt --checkclean on both changed files.tsgo -p extensions/google-meet/tsconfig.jsonclean; extension test-types lane shows only unrelated pre-existing errors inacpxandqa-lab, none ingoogle-meet.Evidence
Drove the real exported
waitForGoogleMeetAuthCodeagainst a genuinely occupied port 8085 on pristinemainand on the patched tree. Before the fix the login aborts withEADDRINUSE; after it falls back to manual paste and returns the auth code. Details below.Real behavior proof
Behavior addressed:
openclaw meet auth loginaborts with EADDRINUSE when localhost:8085 is occupied, instead of falling back to manual paste like the Gemini path.Real environment tested: drove the real exported
waitForGoogleMeetAuthCodefromextensions/google-meet/src/oauth.tsvia tsx on pristine main 3217165 and on the patched tree, with a realnode:httpserver actually bound to port 8085 to occupy it; the realwaitForLocalOAuthCallbacklistener and the real manual-paste parser stayed real, nothing was stubbed.Exact steps or command run after this patch: bind a real http server on localhost:8085, then call
waitForGoogleMeetAuthCode({ manual: false, state, authUrl, promptInput, writeLine })wherepromptInputreturns the redirect URLhttp://localhost:8085/oauth2callback?code=auth-code-123&state=state-token.Evidence after fix:
Observed result after fix: with port 8085 occupied, the login now switches to manual paste and returns the authorization code, where before it aborted with an EADDRINUSE listener error.
What was not tested: no live Google OAuth token exchange against Google's servers; the callback-listener failure and manual fallback are driven against a real local listener, and the provider HTTP exchange is out of scope for this change. Full build not run.