Repository navigation
fix(logs): clean up gateway and channel startup/shutdown log output - #104174
Conversation
Scope Discord slash-command deploy REST diagnostics to command routes so concurrent startup traffic (voice-state probes, channel lookups) keeps its owner's error handling; make per-request deploy error lines verbose-only and drop JSON bodies that only repeat message+code. Log allowlist summaries one line per call so unresolved lines keep their timestamp/subsystem prefix, and skip identity lookups that resolved to themselves. Remove embedded subsystem prefixes, demote routine signal/shutdown/force/postbuild/diag chatter to debug or verbose, merge the duplicate Control UI build notices, drop doctor's duplicate backup line, and name the config surface or platform limit in the transcripts autoStart and command-limit warnings. Fixes #104163
Only omit identity lookups where the input already is the resolved id; name-based lookups that translated to an id stay logged even when the display name matches the input.
test/e2e/qa-lab telegram-bot-token-runtime waits for this line via the injected RuntimeEnv.log; verbose-only logging would deterministically time out that live proof. Comment the contract at the call site.
|
Codex review: found issues before merge. Reviewed July 11, 2026, 1:03 AM ET / 05:03 UTC. Summary PR surface: Source +34, Tests +168, Other +19. Total +221 across 26 files. Reproducibility: yes. from source inspection: comparing the base and proposed conditionals shows that values such as 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: Keep the new one-line summary when the variable is unset, preserve all previously accepted non- Do we have a high-confidence way to reproduce the issue? Yes from source inspection: comparing the base and proposed conditionals shows that values such as Is this the best way to solve the issue? No as currently written. The owner-local logging corrections are narrower and safer than a new startup aggregator, but the runtime-postbuild mode change must preserve its existing environment contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c4f46baec317. Label changesLabel justifications:
Evidence reviewedPR surface: Source +34, Tests +168, Other +19. Total +221 across 26 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
Review history (1 earlier review cycle)
|
|
Merged via squash.
|
…penclaw#104174) * fix(logs): clean up gateway and channel startup/shutdown log output Scope Discord slash-command deploy REST diagnostics to command routes so concurrent startup traffic (voice-state probes, channel lookups) keeps its owner's error handling; make per-request deploy error lines verbose-only and drop JSON bodies that only repeat message+code. Log allowlist summaries one line per call so unresolved lines keep their timestamp/subsystem prefix, and skip identity lookups that resolved to themselves. Remove embedded subsystem prefixes, demote routine signal/shutdown/force/postbuild/diag chatter to debug or verbose, merge the duplicate Control UI build notices, drop doctor's duplicate backup line, and name the config surface or platform limit in the transcripts autoStart and command-limit warnings. Fixes openclaw#104163 * fix(slack): keep bare-name allowlist resolutions in startup log summary Only omit identity lookups where the input already is the resolved id; name-based lookups that translated to an id stay logged even when the display name matches the input. * fix(telegram): keep isolated-ingress readiness marker on the runtime log test/e2e/qa-lab telegram-bot-token-runtime waits for this line via the injected RuntimeEnv.log; verbose-only logging would deterministically time out that live proof. Comment the contract at the call site.
What Problem This Solves
Routine gateway boots print duplicated, mislabeled, and zero-information log lines that bury real problems. Observed on a live
pnpm gateway:watchsession (see linked issue): voice-state probes logged as slash-command deploy errors, the same deploy failure logged twice with the JSON body repeated inside it, unresolved-channel lines printed with no timestamp/subsystem prefix, Slack "resolved" lines that map an id to itself, five log lines for one SIGTERM, doctor printing the backup path twice, and nineruntime-postbuildtiming rows per rebuild.Fixes #104163.
Why This Change Was Made
Each fix targets a specific defect rather than a style preference:
provider.deploy.tsmonkeypatches the sharedclient.restfor the whole deploy window, so unrelated concurrent startup traffic (voice-state probes, channel lookups) picked up thenative-slash-command-deploy-restlabel and was re-logged at error level even when its owner (e.g. the voice manager) already treats the failure as an expected state. The wrapper now passes non-/applications/**/commandspaths straight through.rest:*:errorline is now verbose-only; the single owner-level warning (slash command deploy failed (message send/receive unaffected): ...) is the one non-verbose line per failure.body=— Discord error envelopes that only containmessage+codeare no longer appended, since both already appear in the line.summarizeMappinglogged resolved+unresolved as one\n-joined message; the console logger only prefixes the first line. It now logs one call per line.U0ATMLTKMC3→U0ATMLTKMC3 (id:U0ATMLTKMC3)said nothing three times per boot), and the(id:...)suffix is only added when the id isn't already visible in the line.[discord] discord: ...messages had the channel name baked into the message; the logger already prefixes the subsystem. (The theme-coloredwarn()wrapper defeats the console's redundant-prefix stripper, so this has to be fixed at the call sites.)signal SIGTERM receivedandshutdown started: ...demoted to debug;received SIGTERM; shutting down+shutdown completed cleanly in Nmsremain.logConfigUpdatedalready prints the.bakline; the second print indoctor-health-contributions.tsis removed.run.ts, build notice incontrol-ui-assets.ts) are merged into one line at build time carrying thepnpm ui:build/pnpm ui:devguidance.force: no listeners— demoted to debug when nothing was actually killed.[diag] isolated polling ingress started— intentionally kept at info: thetest/e2e/qa-labtelegram-bot-token runtime waits for this exact marker on the injected runtime log, so demoting it would time out that live proof. The contract is now commented at the call site.runtime-postbuild— one summary line by default (9 phases completed in 903ms (slowest: ...)); per-phase rows viaOPENCLAW_RUNTIME_POSTBUILD_TIMINGS=verbose,0still silences.transcripts autoStart failedconfig error now names the config surface to fix (transcripts.autoStart); command-limit warnings name the platform limit (112 commands exceed the 100-command Telegram limit; ...).A "startup issues summary block" was considered and deliberately not built: channel config findings trickle in for 60s+ after
[gateway] ready(transcripts autoStart fires a minute later), and aggregated reporting already exists inopenclaw channels status/openclaw doctor. The per-line fixes make each remaining line correctly attributed and actionable instead of adding a second, racy aggregator.User Impact
Operators watching gateway logs get one correctly-labeled line per event. Example (default verbosity, from the observed session):
Before
After
The Missing Access probe and Unknown Voice State lines don't disappear from the product — they were never deploy events. The channel probe still surfaces as
channels unresolved(now correctly prefixed), and the voice manager keeps handling its expected 404s verbose-only, as it already did.Doctor no longer prints the backup twice:
Rebuilds print one postbuild line instead of nine (captured from the remote proof build):
OPENCLAW_RUNTIME_POSTBUILD_TIMINGS=verboserestores the per-phase rows;0still silences timings entirely.Evidence
extensions/discord/src/monitor/provider.deploy.test.ts(non-command REST passthrough keeps caller-owned error handling, exactly one warning per deploy failure at default verbosity, redundant-body dedupe), identity-skip coverage insrc/channels/allowlists/resolve-utils.test.tsandextensions/slack/src/monitor/provider.allowlist.test.ts.provider.test.ts,provider.allowlist.test.ts,bot-native-commands.test.ts,resolve-utils.test.ts; subsystem-logger test mocks gained thedebugmethod the demoted lines now use.tbx_01kx7nc2abm64vxh7gwzeghx9r): focused suites green — discord provider/deploy/allowlist, slack allowlist, telegram native commands, channel resolve-utils, gateway run/run-loop/server-close, run-node (7 shards);pnpm check:changedexit 0 (typecheck core/tests/extensions + lint fan-out + guards);pnpm buildexit 0.gpt-5.6-sol): two accepted findings were fixed in follow-up commits — Slack bare-name resolutions (general→ id) are no longer suppressed by the identity filter, and the Telegram isolated-ingress readiness marker stays on the runtime log because thetest/e2e/qa-labbot-token runtime waits for it. The remaining changelog finding is rejected per repo policy (CHANGELOG.mdis release-only; release-note context lives in this PR body and the commit messages).extensions/slack/src/monitor/provider.allowlist.test.ts8/8 green.