Repository navigation
fix(googlechat): block webhook startup without valid audience configuration - #118968
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 5:18 PM ET / 21:18 UTC. ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherGoogle 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]
Decision needed
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
Agent review detailsSecurityNone. PR surfaceSource +13, Tests +62. Total +75 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Summary
Real behavior proof
blocked, clears stale webhook routing, logs actionable configuration guidance, and makes gateway health unhealthy without binding an unusable route.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, andevaluateChannelHealth, 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"}}