Repository navigation
fix(googlechat): report a blocked account instead of staying healthy when webhookUrl cannot be parsed - #117986
Conversation
…hat was never bound An unparseable webhookUrl resolves to no path, and the monitor bails before it creates ingress or registers the HTTP route. The gateway still published the default path, and because this channel never sets connected, health evaluation read healthy for the lifetime of the process while inbound delivery was dead. Make resolveGoogleChatWebhookPath return string | null and have the gateway publish lifecycle: blocked with lastError instead of a path. The status store patch-merges, so the blocked branch clears webhookPath explicitly.
|
Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 9:59 AM ET / 13:59 UTC. ClawSweeper reviewWhat this changesThe PR makes an invalid Google Chat Merge readiness⛔ Blocked until stronger real behavior proof is added - 4 items remain The prior recovery blocker is confirmed in the proposed patch: a corrected Google Chat webhook URL can register a real route but retains the previously patch-merged Priority: P1 Review scores
Verification
How this fits togetherGoogle Chat gateway startup resolves the account's webhook URL, writes a runtime status row, and starts the monitor that registers the inbound HTTP route. Gateway health and operator status consume that row to decide whether the account is ready to receive messages. flowchart LR
A[Google Chat configuration] --> B[Webhook path resolution]
B --> C[Gateway status row]
B --> D[Inbound route monitor]
C --> E[Channel health policy]
D --> F[Webhook route]
E --> G[Operator status]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +17, Tests +92. Total +109 across 3 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Publish one canonical startup snapshot: invalid configuration should set blocked state, while every resolvable startup must explicitly clear blocked lifecycle and the associated error, with an invalid-to-valid restart regression test. Do we have a high-confidence way to reproduce the issue? Yes, from source: start once with an unparseable URL so the patch writes Is this the best way to solve the issue? No: reporting the invalid configuration as blocked is correct, but the PR must also clear that state after a corrected URL resolves and the inbound route starts. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0ac3368c8f44. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What 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
HistoryReview history (2 earlier review cycles)
|
ec49a54 to
9690975
Compare
|
The reported recovery risk is already handled by the canonical channel manager: it resets lifecycle and lastError before every plugin restart (src/gateway/server-channels.ts), and the PR’s real same-manager invalid→valid run proves route registration, cleared errors, and healthy status. Duplicating that reset inside Google Chat or adding a redundant plugin-only regression would weaken ownership; the existing manager regression plus the real recovery proof cover the requested rank-up items. |
* origin/main: fix(ui): label Gateway connection settings for accessibility (#118000) ci(qa): extend profile evidence timeout (#117999) fix(googlechat): report a blocked account instead of a webhook path that was never bound (#117986) fix(line): preserve semantic indentation in fenced code (#117996) fix(plugins): contain rejected synchronous hook results (#117988) fix(cli): preserve shell profiles when completion install fails (#117987) fix(tui): preserve legitimate consecutive backspaces (#117989) fix: preserve queued messages during /compact (#117840) fix(talk): enforce relay lifecycle bounds fix(talk): enforce relay terminal precedence test(talk): cover relay tool-call retention overflow fix(talk): bound relay tool-call lifecycle state
…hat was never bound (openclaw#117986) An unparseable webhookUrl resolves to no path, and the monitor bails before it creates ingress or registers the HTTP route. The gateway still published the default path, and because this channel never sets connected, health evaluation read healthy for the lifetime of the process while inbound delivery was dead. Make resolveGoogleChatWebhookPath return string | null and have the gateway publish lifecycle: blocked with lastError instead of a path. The status store patch-merges, so the blocked branch clears webhookPath explicitly.
* origin/main: fix(ui): label Gateway connection settings for accessibility (openclaw#118000) ci(qa): extend profile evidence timeout (openclaw#117999) fix(googlechat): report a blocked account instead of a webhook path that was never bound (openclaw#117986) fix(line): preserve semantic indentation in fenced code (openclaw#117996) fix(plugins): contain rejected synchronous hook results (openclaw#117988) fix(cli): preserve shell profiles when completion install fails (openclaw#117987) fix(tui): preserve legitimate consecutive backspaces (openclaw#117989) fix: preserve queued messages during /compact (openclaw#117840) fix(talk): enforce relay lifecycle bounds fix(talk): enforce relay terminal precedence test(talk): cover relay tool-call retention overflow fix(talk): bound relay tool-call lifecycle state
Closes #117985
What Problem This Solves
Fixes an issue where operators who set
channels.googlechat.webhookUrlto a value thatnew URL()cannot parse — most easily by leaving offhttps://— get a Google Chat accountthat registers no inbound route and is still reported as healthy. The monitor gives up before
it creates the ingress monitor or registers the HTTP route, but the account never records that
it is unable to receive, so
evaluateChannelHealth— the function both readiness and thechannel health monitor consume — keeps returning healthy. With no route registered the account
cannot receive; the health monitor has no unhealthy verdict to act on,
collectChannelStatusIssuesreports nothing, and in the capture the only signal is one
invalid webhook pathline atstartup.
Why This Change Was Made
The plugin SDK's
resolveWebhookPath(openclaw/plugin-sdk/webhook-ingress) has two callsites in this plugin, both in
extensions/googlechat/src/monitor.ts, and they disagreed about what an unresolvable pathmeans.
monitorGoogleChatProvidercalls it directly and treatsnullas fatal, returningbefore it creates the ingress monitor or registers the HTTP route. The exported wrapper
resolveGoogleChatWebhookPath, whose only production consumer is the gateway, swallowed thesame
nullwith?? "/googlechat"— so the gateway published that default as the account'swebhookPathwhile the monitor had already given up.This PR makes the resolver honest — it now returns
string | null, the same thing themonitor already branches on — and has the gateway publish
lifecycle: "blocked"with alastErrorinstead of a path when no path could be resolved. The status store patch-merges,so the blocked branch clears
webhookPathexplicitly — without that, an account whose earlierrun had bound a path would keep it in the row, because the blocked branch simply omits the key.
That field looks internal:
buildRuntimeAccountStatusSnapshotdoes not project it, andopenclaw channels statusshows the config value instead (resolveAccountSnapshotinchannel.tsputsaccount.config.webhookPathintoextra, which is spread last and wins). Agrep across
src/gateway,src/infra,src/commandsand the gateway protocol found noreader, though that is a search rather than a proof. Clearing it keeps the row internally
consistent; it is not claimed as a second operator-visible symptom.
runningstays true because the account task is alive and waiting on its abort signal;lifecycleis what says the account cannot receive, andevaluateChannelHealthreadslifecycle, notrunning— the same combination Slack's enterprise-install path alreadyproduces for a blocked account.
blockedis theplugin-authored lifecycle on
ChannelAccountSnapshot(
src/channels/plugins/types.core.ts); Slack's enterprise-install path is currently its onlyproducer, and Google Chat becomes the second. The existing core plumbing does the rest:
evaluateChannelHealthreturns{healthy: false, reason: "blocked"}, the health monitor deliberately skips restarting ablocked account, and
collectChannelStatusIssuessurfaces"Channel runtime is blocked and needs operator action.".ingressUnavailablewas considered and not used: it maps to a restart reason inresolveChannelRestartReason, and a config typo is not fixable by restarting, so it wouldput the account in a restart loop. The monitor keeps its own bail and its own registration
error path — parsing a path does not prove registration succeeded, so the later failure path
still has to exist.
Non-scope
This PR is limited to the Google Chat gateway's status publish and the resolver it calls.
resolveWebhookPathkeeps its current semantics. Validation ofwebhookUrlitself belongs tothe config schema (
src/config/zod-schema.providers-googlechat.ts, where it is a plainoptional string) and would reject values accepted today, so it stays a separate decision. The
other channels that call this helper are covered in the sibling table under Evidence.
What changed
extensions/googlechat/src/monitor.tsresolveGoogleChatWebhookPathreturnsstring | null; the?? "/googlechat"fallback is removed. The direct call site and its bail are untouched.extensions/googlechat/src/gateway.tsnull, publishlifecycle: "blocked"+lastErrorand clearwebhookPathinstead of publishing a path.extensions/googlechat/src/setup.test.tsUser Impact
An operator who mistypes
webhookUrlnow sees the Google Chat account reported as blocked,flagged as needing operator action, instead of a healthy account that silently receives
nothing. The rendered issue text is the generic runtime one
("Channel runtime is blocked and needs operator action");
lastErroris carried on the accountrow and is not claimed to render anywhere specific. For a
correctly configured account the route registration and the runtime snapshot are unchanged
(shown in the second capture case); no Google Chat delivery was exercised either way.
Production files change by +26/-9 across two files, 9 of the added lines comments; the whole
three-file PR is +128/-19 including tests.
Evidence
Behavior addressed: a Google Chat account whose
webhookUrlcannot be parsed registers noinbound route, and the health policy keeps returning healthy for it — at every uptime sampled
here, out to a computed 8760h — while inbound delivery is dead.
Real environment tested: Linux, Node v24.18.0, real
createChannelManager(the gateway's ownchannel manager), real bundled
googlechatPlugin, realstartGoogleChatMonitor, realregisterPluginHttpRouteagainst an ephemeral plugin registry, realevaluateChannelHealth,real
collectChannelStatusIssues. Thestored account rowbelow is the row the gatewayitself keeps (
ChannelManager.getRuntimeSnapshot()) after its own patch merge, not a row theharness assembled. No Google Chat workspace, no network.
Exact steps or command run after this patch:
./node_modules/.bin/tsx bl1-boundary-proof.mts(harness source at the end of this section). Head
96909756d793372c81d920c27f59c2ba22576f6e, i.e. basea530a7bd70d4198b87f0ec32f21c2c0854494648plus thispatch; the before run is that base with the patch reverted.
Before evidence:
Evidence after fix:
Observed result after fix: for the unparseable URL the stored row records
blockedwith thereason, no longer carries a
webhookPath, andplugin http routes: []on the same run showsthat nothing was ever bound. Health flips from
healthyat every sampled uptime out to one year to{"healthy":false,"reason":"blocked"}, and the operator surface gains the blocked runtimeissue. The third case restarts the same account through the same manager: before the fix the
row reports the fabricated default
/googlechat— replacing the/gc-inboundthe first runhad bound — with
lifecycle: "starting"and no error; after the fix the row carries no pathat all and is blocked. The fourth case is the recovery direction: an account that started
blocked and is restarted with a corrected URL comes back to
lifecycle: "starting",lastError: null, the resolved path and a registered route, identically before and after thefix.
blockedcannot strand an account because every account start writeslifecycle: "starting",lastError: nullandingressUnavailable: undefinedbefore theplugin's patch is applied (
src/gateway/server-channels.ts, whose comment on that write says"Runtime rows are patch-merged, so a dead-ingress verdict from the previous lifecycle would
outlive the condition it described. Every start re-proves ingress, so every start must clear
it first."). The health monitor's restart takes the same path — it calls
channelManager.startChannel(...)insrc/gateway/channel-health-monitor.ts— so a correctedconfig recovers whether the operator restarts the channel or the monitor does. There is no
route into the plugin's resolved-path publish that skips that write:
startChannelInternalperforms it immediately before the task that calls
startAccount, and a start aimed at anaccount whose task is still live returns early instead of re-entering. The fifth capture case
shows that refusal — a second
startChannelwith a corrected URL and no intervening stopproduces no second start at all (one
starting Google Chat webhookline), which is why therow there still reads blocked. The valid-URL case is identical before and after, including the route
/gc-inboundderived from the URL. In the two healthy cases the row keeps
lifecycle: "starting"at everysampled uptime. That is pre-existing behaviour for a passive webhook channel, which never sets
connectedand so never derivesready. This PR leaves it as is.The blocked snapshot is consumed by paths core already covers:
src/gateway/channel-health-policy.test.ts("treats recorded blocked lifecycle as unhealthy")and
src/infra/channels-status-issues.test.ts("reports blocked lifecycle through the genericruntime path"). Both are channel-agnostic, so a second producer needs no new core test; the
capture above exercises the same two functions with the real Google Chat account row.
What was not tested: whether the runtime
webhookPathreaches any operator surface — it doesnot, by inspection (no reader in
src/gateway,src/infra,src/commandsor the protocol,and the CLI status uses the config value), so that field is not claimed as a user-visible
symptom; delivery of an actual Google Chat event; the health monitor's restart
loop (it skips restart when the reason is
blocked, atsrc/gateway/channel-health-monitor.ts— the skip branch is read from source, and neither theno-restart path nor a manual restart was driven through the monitor loop); the other
resolveWebhookPathcall sites (enumerated below as unaffected).createChannelManager,googlechatPlugin,startGoogleChatMonitor,registerPluginHttpRoute,evaluateChannelHealth,collectChannelStatusIssuesserviceAccountcredentials0.01h…8760hProof limitations or environment constraints: no live Google Chat workspace — sufficient for
this claim because the failing branch returns before ingress creation and before any provider
call, and the same run shows
plugin error: [default] invalid webhook pathwith zeroregistered routes. The harness registers the bundled plugin directly instead of running the
bundled plugin loader, so it grants the plugin the same trusted state facade the loader grants
(
openChannelIngressQueueover a temp state dir,src/plugins/registry-runtime.ts); everyother runtime member is the stock
createPluginRuntime(). TheserviceAccountvalues in theharness config are syntactic placeholders — neither path makes an outbound call, so they are
never used.
up 8760his a computed uptime handed to the real health policy, not a processthat ran for a year. The capture was re-taken at each base
mainmoved to during thework (
af77477a2ad->de0fa7c2084->55816c47d133->a530a7bd70d4, 69 commits) and theobservations did not change.
Tests
extensions/googlechat/src/setup.test.ts— 31 tests, whole file green. Three added:publishes the bound webhook path when the account resolves one— no regression on thevalid path.
reports a blocked lifecycle when the configured webhookUrl resolves to no path—reverting the production change makes exactly this test fail with
expected undefined to be 'blocked'.clears a previously published webhook path when a restart resolves none— drives twostarts through one status snapshot; dropping the explicit
webhookPathclear makesexactly this test fail.
The suite's
channel.runtime.jsmock now delegates the path resolver to the real./monitor.jsimplementation (only the monitor start is stubbed), so the tests cover thewhole chain from configured
webhookUrlto published snapshot.Whole extension suite: 28 files / 300 tests green.
tsgoextensions and extensions-testlanes exit 0. oxlint exit 0.
Sibling surfaces
resolveWebhookPathproduction call sites at basea530a7bd70d4:extensions/googlechat/src/monitor.ts— direct call inmonitorGoogleChatProvidernullas fatal (unchanged by this PR)extensions/googlechat/src/monitor.ts— wrapperresolveGoogleChatWebhookPathextensions/zalo/src/monitor.tsdefaultPath: null, maps a null result toundefined, and gates media hosting on itextensions/zalo/src/outbound-media.tsdefaultPath: nulland throws on nullextensions/synology-chat/src/accounts.tshas its ownresolveWebhookPathSourceand does notuse this helper.
Proof harness
The harness is a one-off driver and is not part of the diff. It is reproduced in full below so
the capture can be re-run: save it at the repo root and run
./node_modules/.bin/tsx bl1-boundary-proof.mts. The other verification wasnode scripts/run-vitest.mjs extensions/googlechat, both tsgo lanes for extensions(production and test tsconfigs) via
scripts/run-tsgo.mjs, andscripts/run-oxlint.mjsoverthe two changed source files.
bl1-boundary-proof.mts (one-off driver, not part of the diff)