Skip to content

Log Discord component registry error details#84190

Merged
steipete merged 5 commits into
openclaw:mainfrom
100menotu001:codex/discord-component-registry-error-details
May 21, 2026
Merged

Log Discord component registry error details#84190
steipete merged 5 commits into
openclaw:mainfrom
100menotu001:codex/discord-component-registry-error-details

Conversation

@100menotu001

@100menotu001 100menotu001 commented May 19, 2026

Copy link
Copy Markdown
Contributor

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

  • Bug fix

Scope

  • Formats thrown registry errors into structured warning metadata.
  • Includes error name, message, stack, and cause details when available.
  • Leaves fallback behavior unchanged.
  • Adds coverage for cause metadata in the warning.

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 an Error cause, 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, and errorCauseMessage metadata.

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 Error fields and cause context.

Regression Test Plan

  • node scripts/run-vitest.mjs extensions/discord/src/components.test.ts src/plugins/runtime/runtime-logging.test.ts

Result: 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

  • Focused regression command passed.
  • Redacted runtime diagnostic above confirms the fallback entry remains available and the real runtime log record includes structured error and cause metadata.

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.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 19, 2026
@clawsweeper

clawsweeper Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Workflow note: Future ClawSweeper reviews update this same comment in place.

How this review workflow works
  • 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.

Summary
The branch adds structured Discord persistent component registry error formatting, forwards plugin runtime logger metadata, adds focused regression tests, and updates the changelog.

Reproducibility: yes. Source inspection on current main shows an openKeyedStore failure reaches the Discord warning path with only String(error), and the runtime logging adapter ignores the metadata argument despite the RuntimeLogger contract accepting it.

PR rating
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Summary: Good normal PR quality: focused implementation, sufficient runtime proof, and no blocking correctness or security finding surfaced in read-only review.

Rank-up moves:

  • none
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
Sufficient (live_output): The PR body includes redacted live runtime output showing fallback remained available and structured error/cause metadata reached the real runtime logging adapter after the patch.

Risk before merge

  • Focused tests were not executed during this read-only review; the PR body reports the targeted node scripts/run-vitest.mjs extensions/discord/src/components.test.ts src/plugins/runtime/runtime-logging.test.ts command passed, and CI should remain the merge gate.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused logging fix after maintainer review and CI, preserving Discord fallback behavior while forwarding structured runtime logger metadata.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge
No ClawSweeper repair lane is needed because the branch already contains the focused fix and I found no actionable review finding; the remaining work is maintainer review and CI gating.

Security
Cleared: No concrete security or supply-chain concern found; the diff changes warning metadata, runtime logger forwarding, tests, and changelog only.

Review details

Best 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 openKeyedStore failure reaches the Discord warning path with only String(error), and the runtime logging adapter ignores the metadata argument despite the RuntimeLogger contract accepting it.

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:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes redacted live runtime output showing fallback remained available and structured error/cause metadata reached the real runtime logging adapter after the patch.

Label justifications:

  • P3: This is a low-risk diagnostics improvement for a recoverable Discord registry fallback path with no user-facing behavior change.
  • rating: 🐚 platinum hermit: Current PR rating is 🐚 platinum hermit because proof is 🐚 platinum hermit, patch quality is 🐚 platinum hermit, and Good normal PR quality: focused implementation, sufficient runtime proof, and no blocking correctness or security finding surfaced in read-only review.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes redacted live runtime output showing fallback remained available and structured error/cause metadata reached the real runtime logging adapter after the patch.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes redacted live runtime output showing fallback remained available and structured error/cause metadata reached the real runtime logging adapter after the patch.

What I checked:

Likely related people:

  • Shakker: Local blame/log attributes the current Discord persistent registry warning, RuntimeLogger contract, and runtime logging adapter baseline to this author in commit 6ccca4a. (role: current-main baseline author in local history; confidence: medium; commits: 6ccca4ae9529; files: extensions/discord/src/components-registry.ts, src/plugins/runtime/runtime-logging.ts, src/plugins/runtime/types-core.ts)
  • steipete: The PR timeline shows this person assigned the PR and force-pushed the current head containing the changelog commit, making them a practical follow-up owner for this active review. (role: recent PR routing and branch updater; confidence: medium; commits: c5ae67e99860; files: CHANGELOG.md)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 8961eae3f022.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels May 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. size: S and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. size: XS labels May 19, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 19, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 19, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 19, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 19, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 19, 2026
@steipete steipete self-assigned this May 21, 2026
@steipete steipete force-pushed the codex/discord-component-registry-error-details branch from d12826f to c5ae67e Compare May 21, 2026 20:46
steipete added a commit to 100menotu001/openclaw that referenced this pull request May 21, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 21, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 21, 2026
@clawsweeper

clawsweeper Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

✨ Hatched: 🌱 uncommon Tiny Clawlet

Hatch command

Comment @clawsweeper hatch when this PR is hatchable.

Hatchability rules:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

Rarity: 🌱 uncommon.
Trait: finds missing screenshots.
Image traits: location CI tidepool; accessory CI status badge; palette amber, ink, and glacier blue; mood bright-eyed; pose holding its accessory up for inspection; shell smooth pearl shell; lighting soft studio lighting; background tiny shells and proof notes.
Share on X: post this hatch
Copy: My PR egg hatched a 🌱 uncommon Tiny Clawlet in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • Hatchability usually comes from sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness. A merged PR is already final, so merge makes the egg hatchable independently.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@steipete

Copy link
Copy Markdown
Contributor

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:

  • git rebase origin/main
  • git diff --check
  • node scripts/run-vitest.mjs extensions/discord/src/components.test.ts src/plugins/runtime/runtime-logging.test.ts

Evidence after fix:

  • Local focused regression: 2 files passed, 11 tests passed.
  • GitHub Actions on c5ae67e: real behavior proof passed; full PR matrix otherwise green/skipped/neutral except one optional non-required non-surface Security High network-ssrf-boundary shard still in progress after an extended wait.
  • Required checks: none reported for this branch by GitHub.

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.

@steipete steipete force-pushed the codex/discord-component-registry-error-details branch from c5ae67e to e327ed6 Compare May 21, 2026 21:11
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 21, 2026
@steipete

Copy link
Copy Markdown
Contributor

Verification update for e327ed6.

  • Rebased again onto current origin/main after base moved.
  • Resolved a changelog-only conflict, keeping the new Ollama entry plus the Discord registry logging entry.
  • Ran git diff --check after the conflict resolution: clean.
  • Prior focused local regression on this patch stack passed: node scripts/run-vitest.mjs extensions/discord/src/components.test.ts src/plugins/runtime/runtime-logging.test.ts; 2 files passed, 11 tests passed.
  • GitHub real behavior proof on e327ed6 passed.
  • GitHub required checks: none reported for this branch.

Proceeding with squash merge. Thanks @100menotu001.

@steipete steipete merged commit f52db02 into openclaw:main May 21, 2026
101 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Landed in f52db02.

Thanks @100menotu001.

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

Labels

channel: discord Channel integration: discord P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discord component registry fallback warning should include error details

2 participants