Repository navigation
refactor(discord): remove retired auto-presence templates - #140463
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 5:46 PM ET / 21:46 UTC. ClawSweeper reviewWhat this changesSimplifies 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 Review scores
Verification
How this fits togetherDiscord 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -60, Tests +25. Total -35 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* 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) ...
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 removeshealthyText,degradedText, andexhaustedText. 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
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:139and disabled mode at:187remain.:56and:73protect degraded output with no profiles and cooldown cleanup while disconnected without a presence send. These cover ordering and payload risks exposed by this deletion.node scripts/check-changed.mjs --base origin/main: exit 0 on clean Blacksmith Testboxtbx_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 resolvedpunycodefrom its user-managed parent install; no parent files or guards were changed.pnpm install --frozen-lockfile --offlineonce; all 65 focused tests passed again. The source patch is identical to the independently reviewed and clean-Testbox-checked patch.852f30652bcaf749b25c227b7622d67b71d3f2bd: no findings, security concerns, or requested rank-up changes. Maintainer source review agrees.