Skip to content

fix(discord): demote expected description truncation logs - #126824

Merged
steipete merged 1 commit into
mainfrom
steipete/fix-discord-truncation-logs
Aug 20, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/fix-discord-truncation-logs

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #126817

What Problem This Solves

Fixes an issue where Discord logged required, successful native-command description truncation as a warning for every oversized retained command on each account start.

Why This Change Was Made

Discord still applies the same 100-character, UTF-16-safe transport normalization to command, option, and localized descriptions. The owner now records that expected adaptation at debug level; invalid-command and deployment failures remain warnings/errors. Shared descriptions stay rich for help, model routing, and sibling channels.

User Impact

Operators no longer receive warning floods for successful Discord catalog construction, so genuine command deployment problems remain visible. Native command payloads and menus are unchanged.

Evidence

  • Live production evidence: 945 truncation warnings in a bounded two-day Gateway corpus; a fresh hour showed the same retained fields warning once per Gateway start.
  • Installed Discord contract: chat-input command and option descriptions are limited to 1-100 characters; localized descriptions follow the same rule.
  • Built-in command and option descriptions are already within the limit. Oversized inputs primarily come from valid shared skills whose descriptions intentionally serve other surfaces.
  • Focused regression: long command, option, and localization payloads retain the same UTF-16-safe 99-character boundary; debug receives the diagnostic and warn remains unused.
  • Focused owner suite: 13/13 passed.
  • Complete Discord extension lane: 2,807/2,807 across 225 files.
  • Changed-file gate passed: format, extension/test typecheck, extension lint, plugin boundaries, dead exports, import cycles, and repository guards.
  • Fresh rebased Codex autoreview: clean, no accepted/actionable findings.
  • Production LOC: +1/-1, net zero. Tests: +17/-2.
  • No payload, command catalog, shared description, transport limit, provider, config, protocol, storage, credential, or UI behavior change.

AI-assisted: implementation and review used Codex, with maintainer inspection of Discord's installed contract, shared skill metadata ownership, sibling transport limits, production logs, history, and tests.

@clawsweeper

clawsweeper Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 20, 2026 20:01
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: XS maintainer Maintainer-authored PR labels Aug 20, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Aug 20, 2026
@clawsweeper

clawsweeper Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 20, 2026, 4:07 PM ET / 20:07 UTC.

ClawSweeper review

What this changes

Changes successful Discord native-command description truncation logs from warning to debug level and adds focused assertions for command, option, and localized descriptions.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking findings. Current main still logs successful Discord description normalization as a warning, while this focused owner-boundary patch preserves payload behavior and moves only that expected diagnostic to debug; keep the maintainer-owned PR open for normal exact-head CI and merge handling.

Priority: P3
Reviewed head: cd422b3e3569c7cd4fcbbc9db839a3327c9d62ad

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with source-backed regression coverage and no correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its body supplies symptom logs and focused after-fix coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its body supplies symptom logs and focused after-fix coverage.
Evidence reviewed 6 items Current-main behavior: Current main still calls warning logging when an over-limit description is normalized, so the user problem is not already solved there.
Owner-boundary patch: The PR changes only the diagnostic level at the helper that owns all command, option, and localization truncation.
Caller and regression coverage: The command builder routes top-level descriptions and localizations through the helper, while focused tests retain UTF-16-safe payload assertions and verify debug is used instead of warn.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs extensions/discord/src/monitor/native-command.options.test.ts

Result: FAIL (failed) — step 1 run node scripts/run-vitest.mjs extensions/discord/src/monitor/native-command.options.test.ts: terminal command did not produce output within 20 seconds: "node scripts/run-vitest.mjs extensions/discord/src/monitor/native-command.options.test.ts"

runner@runnervm76f27:/tmp/clawsweeper-live-proof-126824-AbvC9n/target$ node scripts/run-vitest.mjs extensions/discord/src/monitor/native-command.options.test.ts
[test] starting test/vitest/vitest.extension-discord.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-126824-AbvC9n/target

node scripts/run-vitest.mjs extensions/discord/src/monitor/native-command.options.test.ts













































Assertions:

  • FAIL expect_output: native-command.options.test.ts

How this fits together

The Discord plugin turns shared command metadata into Discord-native commands, applies the transport’s description limit, and then deploys the resulting catalog. This change affects only the diagnostic emitted during that normalization step.

flowchart LR
A[Shared command descriptions] --> B[Discord command builder]
B --> C[UTF-16-safe normalization]
C --> D[Debug diagnostic]
C --> E[Native command payload]
E --> F[Discord deployment]
Loading

Before merge

  • Resolve merge risk (P1) - The head was reported behind main and one exact-head typecheck was still in progress; merge only after GitHub confirms the clean three-way result and required checks complete.
Agent review details

Security

None.

PR surface

Source 0, Tests +15. Total +15 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 17 2 +15
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 18 3 +15

Review metrics

Metric Value Why it matters
Production versus tests production +1/-1; tests +17/-2 The net-neutral logging-level swap is covered at command, option, and localization normalization paths.

Stored data model

Persistent data-model change detected: serialized state: extensions/discord/src/monitor/native-command.options.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #126817
Summary: This PR is the explicit candidate fix for the linked warning-noise report.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the logging classification at the Discord transport boundary, preserve the existing truncation and payload behavior, and merge after exact-head validation completes.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the logging classification at the Discord transport boundary, preserve the existing truncation and payload behavior, and merge after exact-head validation completes.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main’s normalization helper emits the warning for over-limit retained descriptions, and the focused test constructs command, option, and localization inputs that take that path.

Is this the best way to solve the issue?

Yes. Changing the diagnostic classification at the Discord-owned normalization boundary is narrower and safer than shortening shared descriptions or changing deployment behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a4901b629101.

Labels

Label changes:

  • add P3: This is a low-blast-radius operator-log-noise repair; command payloads and deployment behavior are unchanged.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its body supplies symptom logs and focused after-fix coverage.

Label justifications:

  • P3: This is a low-blast-radius operator-log-noise repair; command payloads and deployment behavior are unchanged.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its body supplies symptom logs and focused after-fix coverage.

Evidence

What I checked:

Likely related people:

  • steipete: Current blame and the recent native-command history connect this contributor to the exact Discord command-construction boundary. (role: recent Discord native-command contributor; confidence: high; commits: cd422b3e3569, d6f70a96cb1c; files: extensions/discord/src/monitor/native-command.options.ts, extensions/discord/src/monitor/native-command.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let the in-progress exact-head typecheck complete before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head cd422b3e3569c7cd4fcbbc9db839a3327c9d62ad:

  • Root cause: the Discord-owned normalization helper classified successful required description truncation as a warning even though richer shared skill descriptions are intentional and payload construction continues normally.
  • Canonical fix: change only that expected diagnostic from warn to debug; preserve UTF-16-safe truncation, command/option/localization payloads, shared metadata, limits, and deployment failures.
  • Live production evidence: 945 warnings in a bounded two-day Gateway corpus; a fresh hour showed retained fields warning once per Gateway start.
  • Installed Discord contract: chat-input command and option descriptions are 1-100 characters; localizations follow the same limit.
  • Focused regression: long command, option, and localization payload boundaries unchanged; debug receives the detail and warn is unused.
  • Focused owner suite: 13/13 passed.
  • Complete Discord extension lane: 2,807/2,807 across 225 files.
  • Changed gate: format, extension/test typecheck, extension lint, plugin boundaries, dead exports, import cycles, and repository guards passed.
  • Fresh rebased Codex autoreview: clean, no accepted/actionable findings.
  • Production LOC: +1/-1, net zero. Tests: +17/-2.
  • ClawSweeper review: no findings/security concern and agrees this is the best owner-boundary fix. Its remote command started the correct test but exceeded the wrapper's 20-second output deadline during import; local focused and full extension proofs above completed successfully.
  • Exact-head CI: run 32411798290 is green with zero pending checks.
  • No payload, command catalog, shared description, transport limit, provider, config, protocol, storage, credential, or UI behavior change.

@steipete
steipete merged commit a4178c7 into main Aug 20, 2026
162 of 171 checks passed
@steipete
steipete deleted the steipete/fix-discord-truncation-logs branch August 20, 2026 20:26
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

channel: discord Channel integration: discord maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

[Bug]: Expected Discord description truncation floods warning logs

1 participant