Skip to content

fix(googlechat): block webhook startup without valid audience configuration - #118968

Merged
steipete merged 2 commits into
mainfrom
codex/qa0803-googlechat-webhook-auth-readiness
Aug 3, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/qa0803-googlechat-webhook-auth-readiness

Conversation

@steipete

@steipete steipete commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Validate the effective Google Chat webhook audience and audience type before creating an inbound route.
  • Publish an actionable blocked channel lifecycle instead of advertising a healthy connected account whose every webhook request must fail authentication.
  • Preserve incremental setup, inherited account settings, valid app-URL/project-number audiences, and existing bind-failure cleanup.

Real behavior proof

  • Reproduced actual token-only setup, production JWT verification rejection, false-ready monitor state, and a misleading healthy gateway result.
  • The repaired production monitor publishes blocked, clears stale webhook routing, logs actionable configuration guidance, and makes gateway health unhealthy without binding an unusable route.
  • Five failing lifecycle regressions before the repair; eight complete lifecycle tests and four existing setup/inheritance scenarios now pass.
  • Direct google-auth-library 10.9.1 source inspection confirms audience enforcement.
  • Independent formal review: no P0/P1 findings; confidence 0.94.
  • No CLI compatibility, configuration shape, schema, or public API changes.

Inspectable production monitor, JWT, route, and gateway-health proof

Actual token-only setup and production JWT authentication before repair demonstrate the misleading healthy account even though every webhook is rejected:

{"validation":null,"persistedAudience":null,"persistedAudienceType":null,"missingAudience":{"ok":false,"reason":"missing audience"},"missingAudienceType":{"ok":false,"reason":"unsupported audience type"},"health":{"healthy":true,"reason":"healthy"}}

After repair, the actual account resolver, JWT owner, monitor, and gateway-health evaluator produce an actionable blocked state; no HTTP route is registered:

{"setupAccepted":true,"request":{"ok":false,"reason":"missing audience"},"routes":[],"snapshot":{"enabled":true,"configured":true,"lifecycle":"blocked","terminalDisconnect":true,"lastError":"Google Chat webhook authentication requires channels.googlechat.audienceType and channels.googlechat.audience.","running":true,"connected":false},"health":{"healthy":false,"reason":"blocked"},"loggedErrors":1}

Both supported valid audience modes still register the real plugin-owned webhook and become ready. These outputs use the actual startGoogleChatMonitor, withPluginHttpRouteRegistry, and evaluateChannelHealth, with an empty isolated in-memory queue; no credentials, live network, or authentication secrets:

{"audienceType":"app-url","audience":"https://chat.example.invalid/googlechat","routes":[{"path":"/googlechat","pluginId":"googlechat","source":"googlechat-webhook","auth":"plugin"}],"snapshot":{"enabled":true,"configured":true,"running":true,"connected":true,"lifecycle":"ready","lastError":null},"health":{"healthy":true,"reason":"healthy"}}
{"audienceType":"project-number","audience":"123456789012","routes":[{"path":"/googlechat","pluginId":"googlechat","source":"googlechat-webhook","auth":"plugin"}],"snapshot":{"enabled":true,"configured":true,"running":true,"connected":true,"lifecycle":"ready","lastError":null},"health":{"healthy":true,"reason":"healthy"}}

@openclaw-barnacle openclaw-barnacle Bot added channel: googlechat Channel integration: googlechat size: S maintainer Maintainer-authored PR labels Aug 3, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 5:18 PM ET / 21:18 UTC.

ClawSweeper review

What this changes

The branch prevents Google Chat from registering a webhook route when its required authentication audience is absent or invalid, publishing a blocked channel state instead of ready.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 4 items remain

Keep this PR open for protected-label maintainer handling. The implementation places the authentication prerequisite at the correct pre-registration lifecycle boundary and has focused coverage, but the external-PR proof gate still needs inspectable after-fix runtime evidence.

Priority: P1
Reviewed head: 0276da2e262d85b64ba00afbe008923c5ee1beff
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is focused and source-supported, but its external-PR real-behavior proof is descriptive rather than inspectable.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: The PR body describes a real token-only reproduction, but it provides no inspectable redacted runtime output, log, recording, or linked artifact showing the after-fix blocked status; tests and CI are supplemental only. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The PR body describes a real token-only reproduction, but it provides no inspectable redacted runtime output, log, recording, or linked artifact showing the after-fix blocked status; tests and CI are supplemental only. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 7 items Current-main failure path: Current main resolves the audience, starts ingress, registers the webhook target, and publishes ready without first requiring an audience; a token-only account can therefore advertise a usable route.
Authentication contract: The request verifier rejects an empty audience before attempting token verification, proving that the current route cannot authenticate inbound requests when that setting is absent.
Documented configuration contract: The Google Chat documentation says audienceType and audience determine token validation, and its troubleshooting section states that both are required.
Findings None None.
Security None None.

How this fits together

Google Chat gateway startup resolves an account’s webhook settings and starts a monitor that registers the inbound route. That monitor passes the configured audience to token verification, while its lifecycle status feeds gateway health and operator diagnostics.

flowchart LR
  A[Google Chat account config] --> B[Gateway startup]
  B --> C[Monitor validates webhook path and audience]
  C -->|valid| D[Register inbound webhook route]
  D --> E[Verify Google Chat token]
  C -->|invalid| F[Blocked channel status]
  F --> G[Gateway health and operator guidance]
Loading

Decision needed

Question Recommendation
Should this protected Google Chat lifecycle repair merge after the contributor supplies inspectable runtime proof of the intentional fail-closed behavior? Request runtime proof first: Ask for redacted gateway status or logs showing missing audience blocks startup without a route and valid audience settings still reach ready.

Why: The code repair is source-supported, but the protected maintainer label and the external-PR real-behavior-proof gate require a human merge decision after the upgrade-facing behavior is demonstrated.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The PR body describes a real token-only reproduction, but it provides no inspectable redacted runtime output, log, recording, or linked artifact showing the after-fix blocked status; tests and CI are supplemental only. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - Existing token-only Google Chat configurations currently bind a route despite inevitably rejecting webhook authentication; merging intentionally converts that false-ready route into a blocked state requiring the already-documented audience configuration.
  • Resolve merge risk (P1) - The PR body describes a real reproduction, but it contains no inspectable redacted runtime output, recording, or linked artifact that directly demonstrates the repaired blocked status.
Agent review details

Security

None.

PR surface

Source +13, Tests +62. Total +75 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 14 1 +13
Tests 1 65 3 +62
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 79 4 +75

Review metrics

Metric Value Why it matters
Production vs test delta production +13, tests +62 The production growth creates one pre-bind lifecycle boundary, while the test growth covers two accepted audience modes and five invalid configurations.

Merge-risk options

Maintainer options:

  1. Add redacted upgrade proof before merge (recommended)
    Show that an existing token-only setup now reports blocked with no webhook route, and that both documented audience modes still start normally.
  2. Accept the intentional fail-closed change
    Merge with the understanding that incomplete Google Chat configurations will require operators to add the documented audience settings before inbound webhooks can start.

Technical review

Best possible solution:

Retain the pre-bind validation and add redacted gateway status or log evidence showing that a token-only setup remains unbound and visibly blocked while valid app-URL and project-number setups register normally.

Do we have a high-confidence way to reproduce the issue?

Yes, from current source: a webhook-path account without an audience reaches route registration and ready status, while the verifier rejects it as missing an audience. This read-only review did not execute the path.

Is this the best way to solve the issue?

Yes: validating before ingress and route registration is the narrowest owner-boundary repair, preventing false readiness rather than allowing every inbound request to fail later in authentication.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 361c07f9932b.

Labels

Label changes:

  • add P1: The PR repairs a Google Chat inbound path that can advertise readiness even though every webhook request will fail authentication.
  • add merge-risk: 🚨 compatibility: Merging changes existing incomplete Google Chat setups from registering a doomed route to an explicitly blocked state requiring documented audience configuration.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body describes a real token-only reproduction, but it provides no inspectable redacted runtime output, log, recording, or linked artifact showing the after-fix blocked status; tests and CI are supplemental only. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P1: The PR repairs a Google Chat inbound path that can advertise readiness even though every webhook request will fail authentication.
  • merge-risk: 🚨 compatibility: Merging changes existing incomplete Google Chat setups from registering a doomed route to an explicitly blocked state requiring documented audience configuration.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body describes a real token-only reproduction, but it provides no inspectable redacted runtime output, log, recording, or linked artifact showing the after-fix blocked status; tests and CI are supplemental only. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • steipete: Peter Steinberger authored the current Google Chat monitor history, the channel lifecycle-status refactor, and the proposed repair. (role: recent area contributor; confidence: high; commits: f9d9d1225a1c, a89086282a45, 7c536eea2e77; files: extensions/googlechat/src/monitor.ts, extensions/googlechat/src/gateway.ts, extensions/googlechat/src/monitor.lifecycle.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach redacted gateway status or logs proving missing audience blocks startup without registering a route.
  • Show a redacted successful startup for both documented audience modes, or explain why one representative live setup covers both.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 386228a into main Aug 3, 2026
103 of 111 checks passed
@steipete
steipete deleted the codex/qa0803-googlechat-webhook-auth-readiness branch August 3, 2026 21:31
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: googlechat Channel integration: googlechat maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant