Log Discord component registry error details#84190
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. Source inspection on current main shows an PR rating Rank-up moves:
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. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the focused logging fix after maintainer review and CI, preserving Discord fallback behavior while forwarding structured runtime logger metadata. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection on current main shows an Is this the best way to solve the issue? Yes. The PR is a narrow owner-boundary fix: it formats the caught registry error at the Discord call site and fixes the generic runtime logging adapter to forward existing metadata without changing fallback behavior. Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 8961eae3f022. |
d12826f to
c5ae67e
Compare
|
ClawSweeper PR egg ✨ Hatched: 🌱 uncommon Tiny Clawlet Hatch commandComment Hatchability rules:
Rarity: 🌱 uncommon. What is this egg doing here?
|
|
Pre-merge verification for c5ae67e. Behavior addressed: Discord persistent component registry fallback warnings now keep structured Error and cause metadata, and plugin runtime logging forwards metadata to the underlying logger. Real environment tested: local OpenClaw checkout rebased onto current origin/main, plus GitHub Actions on the pushed PR head. Exact steps or command run after this patch:
Evidence after fix:
Observed result after fix: fallback registry resolution remains available, Discord warning metadata includes error/cause details, and runtime logger metadata reaches child logger methods. What was not tested: no live Discord send; this is deterministic fallback logging and covered by focused runtime tests plus CI. Thanks @100menotu001. |
c5ae67e to
e327ed6
Compare
|
Verification update for e327ed6.
Proceeding with squash merge. Thanks @100menotu001. |
|
Landed in f52db02.
Thanks @100menotu001. |
Summary
Logs structured details when the Discord persistent component registry falls back after a state-store failure.
Motivation
Closes #84185.
The fallback is intentionally recoverable, but the warning previously only logged
String(error), which made storage and runtime failures harder to distinguish.Change Type
Scope
Linked Issue/PR
Closes #84185.
Real Behavior Proof
Behavior or issue addressed: When the Discord persistent component registry cannot open its keyed store, fallback behavior must still work and the real plugin runtime logger must preserve structured error and cause metadata.
Real environment tested: Redacted OpenClaw development checkout on this PR branch, using the Discord component registry runtime with a deliberately failing keyed-store open path.
Exact steps or command run after this patch: Ran a runtime diagnostic using
createRuntimeLogging(), injected a store-open failure with anErrorcause, registered Discord component entries, resolved a fallback entry, and captured the redacted JSON log record emitted through the real runtime logging adapter.Evidence after fix: Redacted runtime output:
{ "fallbackEntryAvailable": true, "warningMessage": "Discord persistent component registry state failed", "structuredMetadata": { "errorName": "Error", "errorMessage": "redacted registry state open failed", "errorCauseName": "TypeError", "errorCauseMessage": "redacted state backend unavailable" } }Earlier call-site diagnostic before the runtime adapter fix:
{ "fallbackEntryAvailable": true, "warning": { "message": "Discord persistent component registry state failed", "errorName": "Error", "errorMessage": "redacted registry state open failed", "errorCauseName": "TypeError", "errorCauseMessage": "redacted state backend unavailable" } }Observed result after fix: Fallback registry resolution remained available, and the warning emitted through the real runtime logging adapter retained
errorName,errorMessage,errorCauseName, anderrorCauseMessagemetadata.Not tested: No live Discord provider send was needed for this persistent-registry fallback logging path.
Root Cause
The registry warning collapsed the thrown value to a single string, discarding structured
Errorfields andcausecontext.Regression Test Plan
node scripts/run-vitest.mjs extensions/discord/src/components.test.ts src/plugins/runtime/runtime-logging.test.tsResult: 2 files passed, 10 tests passed.
User-visible / Behavior Changes
No user-facing behavior change. Operators get more actionable warning metadata when persistent component state fails and OpenClaw falls back to in-memory state.
Diagram
N/A. This is warning metadata only.
Security Impact
No new secrets, permissions, or external calls. The logged metadata is limited to the caught error details already available in-process.
Repro + Verification
Before this change, the fallback warning only included
String(error), and the production runtime logging adapter dropped metadata arguments. The new regression tests verify name, message, and cause details at the Discord call site and metadata forwarding in the runtime logger adapter; the redacted runtime diagnostic confirms fallback remains available and the real log record carries the structured metadata.Evidence
Human Verification
No live Discord service is required for this deterministic fallback logging path.
Compatibility / Migration
Backward compatible. The warning message text is unchanged, and metadata gains additional fields.
Risks
Low. The formatter is best-effort and is wrapped by the existing logging guard.