fix(googlechat): fix googlechat grant_type#78554
Conversation
|
Codex review: found issues before merge. Reviewed July 3, 2026, 5:07 PM ET / 21:07 UTC. Summary PR surface: Source +80, Tests -1, Docs +1, Config -1, Other -3. Total +76 across 7 files. Reproducibility: yes. at source/proof level, but not from a fresh live current-main run: the reporter provided Google Chat setup steps, logs, and before/after screenshots, and the implicated auth transport path is clear in source. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 findings
Review detailsBest possible solution: Rebase or replace the branch, remove the release-owned changelog edit, align package/lock/shrinkwrap contracts, and refresh Google Chat token-exchange proof; if current releases already fix the bug, close this PR and the linked report with shipped proof. Do we have a high-confidence way to reproduce the issue? Yes at source/proof level, but not from a fresh live current-main run: the reporter provided Google Chat setup steps, logs, and before/after screenshots, and the implicated auth transport path is clear in source. Is this the best way to solve the issue? Unclear as-is: the PR is a plausible dependency-backed fix, but the branch is conflicting, the plugin package graph is unaligned, and later user evidence suggests current releases may already work. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 010b61746379. Label changesLabel justifications:
Evidence reviewedPR surface: Source +80, Tests -1, Docs +1, Config -1, Other -3. Total +76 across 7 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
|
|
why does @clawsweeper bot add the proof:sufficient label only to be immediately removed by the @openclaw-barnacle bot? |
0513ea7 to
2d2b840
Compare
2d2b840 to
cca1242
Compare
ac15c5b to
1bcd48f
Compare
1bcd48f to
691fe51
Compare
691fe51 to
60899c2
Compare
…ctor in recent refactor of gaxios, Google chat was broken. openclaw#77307 has more details. Resolves the unsupported_grant_type error by ensuring we instantiate the exact same version of Gaxios that google-auth-library uses internally. Previously, the dynamic import('gaxios') resolved to a hoisted version (6.7.1) in the workspace instead of the version (7.1.4) required by [email protected]. The older version did not natively handle URLSearchParams, leading to the body being stringified as JSON ("{}") and the token exchange failing due to missing grant type fields. Recent refactoring introduced a native Headers conversion that broke gaxios 7.x, as it uses direct property assignment (e.g. headers['Content-Type']) to prepare form-data bodies. Native Headers objects ignore these assignments, causing requests to be sent without the required application/x-www-form-urlencoded header. Changes: Replace native Headers conversion in normalizeGoogleAuthPreparedRequestHeaders with a compatibility layer that adds get/set/has/delete to the plain headers object. Update createGoogleAuthFetch to correctly extract method, headers, and body when called with a native Request object. Add regression test for Request property preservation.
60899c2 to
dba11d8
Compare
|
I'm seeing the same errors for googlechat as @donbowman on versions > 2025.5.6, and reverting to 2025.4.29 brought me back to a good state. We're working through a separate gaxios-related issue but if this PR isn't merged in the next few days, we'll try applying it manually on a more recent version. |
|
i gave up rebasing this, i will if there's interest, but w/o a reviewer and no prospect of merging it, it seemed like a waste of time to me. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
It has taken me longer to get back to this than I hoped but we will need G Chat integration in a current version in the next 1-2 weeks, and I'm still pinned to 2025.4.29 because of the bug. If this hasn't been superseded by other work, I'd be happy to help with pushing this through, but likely won't have a chance until early next week. |
afaik its still needed. feel free to push this, i've pretty much given up, its a lot of work rebasing all the time for no progress. i've given up on openclaw and switched to hermes. |
|
@donbowman I know you've moved on from trying to rebase this but commenting here for completeness that googlechat now works end-to-end for us on 2026.6.6, whereas it hadn't through most 2026.5.x releases. Presumably recent work on googlechat has superseded this. I will have a googlechat PR of my own for supporting ADC shortly; hopefully I won't run into the same issues you did. |



Summary
in recent refactor of gaxios, Google chat was broken. #77307 has more details.
Resolves the
unsupported_grant_typeerror by ensuring we instantiate the exact same version ofGaxiosthatgoogle-auth-libraryuses internally.Previously, the dynamic
import('gaxios')resolved to a hoisted version (6.7.1) in the workspace instead of the version (7.1.4) required by[email protected]. The older version did not natively handleURLSearchParams, leading to the body being stringified as JSON ("{}") and the token exchange failing due to missing grant type fields.Recent refactoring introduced a native
Headersconversion that brokegaxios 7.x, as it uses direct property assignment (e.g.
headers['Content-Type'])to prepare form-data bodies. Native
Headersobjects ignore theseassignments, causing requests to be sent without the required
application/x-www-form-urlencodedheader.Changes:
Headersconversion innormalizeGoogleAuthPreparedRequestHeaderswith a compatibility layer that adds
get/set/has/deleteto theplain headers object.
createGoogleAuthFetchto correctly extractmethod,headers,and
bodywhen called with a nativeRequestobject.Requestproperty preservation.Problem: resolves [Bug]: googlechat broken in 2026-05-01 (working in 2026-04-29): Google Chat message send failed: Error: unsupported_grant_type: Invalid grant_type: , 76742 and 76880 not resolved, reopen #77307 Google chat was broken in recent refactoring
Why it matters:
What changed: Google chat, headers,
What did NOT change (scope boundary): no change in functionality or other modules
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
External contributors must show after-fix evidence from a real OpenClaw setup. Unit tests, mocks, lint, typechecks, snapshots, and CI are supplemental only. Screenshots are encouraged even for CLI, console, text, or log changes; terminal screenshots and copied live output count. Be mindful of private information like IP addresses, API keys, phone numbers, non-public endpoints, or other private details when providing evidence.
Behavior or issue addressed: Corrects #77307 breakage of googlechat
Real environment tested: Ubuntu 26.04 with OpenClaw from pnpm and git
Exact steps or command run after this patch: enable googlechat, send a message to opencaw
Evidence after fix (screenshot, recording, terminal capture, console output, redacted runtime log, linked artifact, or copied live output): screenshot
Observed result after fix:
What was not tested: I ran the standard unit tests. I tested googlechat. I didn't test beyond that, the patch is self contained and small
Before evidence (optional but encouraged):
after-fix evidence is below, its a screen shot of it working. this is a real OpenClaw setup.
its a bit hard to show the missing log for the error :)
Google chat now works for me, no longer exiting early with logs.
Ubuntu 26.04 was env tested. I tested manually with googlechat service account.
here is a screenshot

Root Cause (if applicable)
For bug fixes or regressions, explain why this happened, not just what changed. Otherwise write
N/A. If the cause is unclear, writeUnknown.Regression Test Plan (if applicable)
For bug fixes or regressions, name the smallest reliable test coverage that should catch this. Otherwise write
N/A.User-visible / Behavior Changes
List user-visible changes (including defaults/config).
If none, write
None.none
Diagram (if applicable)
For UI changes or non-trivial logic flows, include a small ASCII diagram reviewers can scan quickly. Otherwise write
N/A.N/A
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
see screenshot

Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No)Yes/No)Yes/No)Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.