Skip to content

refactor(discord): remove retired auto-presence templates - #140463

Merged
steipete merged 1 commit into
mainfrom
steipete/deletion-discord-presence-templates
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/deletion-discord-presence-templates

Conversation

@steipete

@steipete steipete commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Discord auto-presence still carried custom-text rendering and extra decision metadata after that configuration surface was retired. Every reachable generated status now uses a fixed string, but the old template and fallback paths obscured the state-to-presence mapping.

Why This Change Was Made

Remove retired template/reason plumbing, unread private decision fields, the unreachable model-unavailable fallback, and unused interval-injection options. Return the existing Discord presence payload directly. Preserve configured healthy activities, availability classification, cooldown mutation, disconnected suppression, error handling, refresh, throttling, and signatures.

The retirement is explicit: edecdbd05ef (#111527) removed custom-text schema/runtime readers; Doctor already removes healthyText, degradedText, and exhaustedText. The remaining legacy type is Doctor-only input. af3d796e199 (#107714) made the decision builder private, and its only caller reads the presence payload. Exhausted state is produced only after the exhausted-reason check, so the alternate template cannot be reached. No config/schema/migration changes are needed here. Follow-up deletion work for #135868.

User Impact

No intended behavior change. Healthy presence stays online with configured activity, degraded presence stays idle with “runtime degraded”, and exhausted presence stays dnd with “token exhausted”. Production +24/−84 (net −60); tests +55/−30 (net +25).

Evidence

  • Seven focused boundary cases passed against original production code before the refactor. Afterward, all 65 tests across auto-presence, presence, provider startup, and provider suites passed.
  • Existing exhaustion tests and their one-use helper are consolidated at extensions/discord/src/monitor/auto-presence.test.ts:31 (rate-limit and overloaded rows); both original behaviors remain covered. Recovery remains at :89, now also checking configured healthy activity; refresh at :139 and disabled mode at :187 remain.
  • Added cases at :56 and :73 protect degraded output with no profiles and cooldown cleanup while disconnected without a presence send. These cover ordering and payload risks exposed by this deletion.
  • Independent Codex review: scoped-clean through P2. Full node scripts/check-changed.mjs --base origin/main: exit 0 on clean Blacksmith Testbox tbx_01m1w9ztecj52rzx0gkbrrr4s9, including lint and import cycles. Run. The one-shot lease completed and stopped; the backing Actions session can show cancellation during that cleanup. Local changed checks passed typechecking but lint was blocked because this nested worktree resolved punycode from its user-managed parent install; no parent files or guards were changed.
  • Tests use an isolated state directory and a mocked Discord gateway boundary. No live Discord account was exercised; external API behavior is unchanged.
  • Rebase updated main's Proxyline dependency from 0.3.7 to 0.3.11. Ran pnpm install --frozen-lockfile --offline once; all 65 focused tests passed again. The source patch is identical to the independently reviewed and clean-Testbox-checked patch.
  • Exact-head CI watcher: GREEN. A cancelled older ClawSweeper dispatch was superseded by a successful same-head dispatch; the existing watcher reconciled it without reruns or guard changes.
  • ClawSweeper reviewed exact head 852f30652bcaf749b25c227b7622d67b71d3f2bd: no findings, security concerns, or requested rank-up changes. Maintainer source review agrees.

@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 6, 2026 21:39
@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: S maintainer Maintainer-authored PR labels Sep 6, 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 Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 5:46 PM ET / 21:46 UTC.

ClawSweeper review

What this changes

Simplifies Discord’s automatic presence updates by removing retired template handling and unused internal plumbing while preserving existing statuses and configured healthy activities.

Merge readiness

✅ Ready for maintainer review

This remains a useful, bounded cleanup absent from current main. No actionable correctness or security defect was found; the maintainer-authored PR should proceed through normal merge checks.

Priority: P3
Reviewed head: 852f30652bcaf749b25c227b7622d67b71d3f2bd

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving simplification with useful boundary coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored cleanup is exempt from external-contributor live proof; supplied tests exercise the production presence controller with a mocked Discord gateway, and no live Discord run is claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored cleanup is exempt from external-contributor live proof; supplied tests exercise the production presence controller with a mocked Discord gateway, and no live Discord run is claimed.
Evidence reviewed 6 items Introduced change and behavior preservation: The complete pinned introduction patch removes private decision metadata and template processing. Exhausted state still requires an exhausted reason, making the removed alternate text unreachable; healthy activities, cooldown evaluation, connection suppression, signatures, throttling, refresh, and timer cleanup remain.
Cleanup remains absent from main and latest release: Both fetched main and v2026.9.2 retain the template renderer and decision wrapper. Their existing configuration reader already ignores custom status text, so this PR removes residual machinery rather than retiring another supported setting.
Existing configuration and migration boundary: The Discord schema accepts only enabled and the two timing fields for auto-presence. Existing Doctor migration removes healthyText, degradedText, and exhaustedText; the remaining exhaustedText type is explicitly Doctor-only legacy input. This PR changes neither schema nor migration.
Findings None None.
Security None None.

How this fits together

Discord auto-presence reads provider availability and configured activity, then produces the bot’s online, idle, or do-not-disturb presence. Its controller suppresses disconnected sends and throttles repeated updates.

flowchart LR
  A[Provider availability] --> C[Classify runtime health]
  B[Configured activity] --> D[Build Discord presence]
  C --> D
  D --> E[Connection and update guards]
  E --> F[Discord bot presence]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -60, Tests +25. Total -35 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 24 84 -60
Tests 1 55 30 +25
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 79 114 -35

Review metrics

None.

Technical review

Best possible solution:

Keep one direct state-to-presence mapping while retaining the existing configuration, Doctor migration, and controller lifecycle.

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

Not applicable: this is behavior-preserving cleanup, and source inspection establishes that the retired template machinery remains on main.

Is this the best way to solve the issue?

Yes. Returning the existing presence payload directly removes unreachable processing without adding a competing API or altering user settings.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6e9ee8af41d3.

Labels

Label changes:

  • add P3: This removes obsolete internal machinery without changing supported Discord presence behavior.
  • 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: The maintainer-authored cleanup is exempt from external-contributor live proof; supplied tests exercise the production presence controller with a mocked Discord gateway, and no live Discord run is claimed.

Label justifications:

  • P3: This removes obsolete internal machinery without changing supported Discord presence behavior.
  • 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: The maintainer-authored cleanup is exempt from external-contributor live proof; supplied tests exercise the production presence controller with a mocked Discord gateway, and no live Discord run is claimed.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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
steipete merged commit 615e964 into main Sep 6, 2026
164 of 165 checks passed
@steipete
steipete deleted the steipete/deletion-discord-presence-templates branch September 6, 2026 21:51
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
* commit '294df333c58f2da104eccffc623ccb3c4d43d4d8': (1802 commits)
  fix: clear stale diagnostics after Gateway changes (#140426)
  fix: keep plugin catalogs intact after discovery timeouts (#140441)
  perf(tui): prepare session picker rows once per overlay (#140462)
  refactor(config): reuse environment substitution for write-back (#140460)
  refactor(discord): remove retired auto-presence templates (#140463)
  fix(ui): finish roster refreshes during session activity (#140459)
  fix(setup): match prepared credentials to the model provider (#140461)
  fix: keep MiniMax discovery on the selected credential (#140438)
  refactor(tests): remove unused parent context cache reset (#140456)
  fix: avoid repeated xAI OAuth refresh during discovery (#140434)
  perf(routing): reuse prepared event session targets (#140454)
  fix(media): keep deferred audio and extraction providers discoverable (#139231)
  refactor(codex): remove redundant app-server forwarding (#140451)
  fix(test): avoid false native polling timeouts (#140119)
  test(gateway): retain saved source in reload fixtures (#140453)
  fix(gateway): reduce repeated model work when listing sessions (#140414)
  fix(feishu): fall back to post mode over table limit (#136382)
  fix: use the bundle-compatible Proxyline runtime under Bun (#140411)
  refactor(trace): reuse the canonical usage counter type (#140444)
  refactor(node-host): share execution policy result fields (#140446)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
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: 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.

1 participant