feat: proactive Slack token health check and gateway crash prevention#119
feat: proactive Slack token health check and gateway crash prevention#119
Conversation
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe changes implement startup resilience improvements for OpenClaw gateway, including Slack token validation prior to bootstrap, stale lock file cleanup mechanisms across startup phases, a readiness probe attempt timeout to prevent infinite retries, and updated Slack OAuth setup instructions. A comprehensive design document cataloging startup crash scenarios and their mitigations is added. Changes
Sequence Diagram(s)sequenceDiagram
participant Gateway as Gateway Bootstrap
participant SlackAPI as Slack Token<br/>Validator
participant FS as File System
participant SessionMgr as Session Lock<br/>Cleanup
participant GatewayLocks as Gateway Lock<br/>Cleanup
Gateway->>SlackAPI: checkSlackTokens()
alt Token Check Passes
SlackAPI-->>Gateway: success
Gateway->>Gateway: log token health OK
else Token Check Fails
SlackAPI-->>Gateway: error reason
Gateway->>Gateway: log warning, continue
end
Gateway->>SessionMgr: clearStaleSessionLocks()
SessionMgr->>FS: cleanup session.* files
FS-->>SessionMgr: complete
SessionMgr-->>Gateway: done
Gateway->>GatewayLocks: clearStaleGatewayLocks()
GatewayLocks->>FS: readdir tmpdir/openclaw-{uid}
FS-->>GatewayLocks: list files
GatewayLocks->>FS: remove gateway.*.lock files
FS-->>GatewayLocks: cleanup complete
GatewayLocks-->>Gateway: log cleanup count
Gateway->>Gateway: fetchInitialConfigWithRetry()
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
* feat(web): add Seedance 2.0 promo banner and modal flow Add a dismiss-once promo banner on Home (both idle and active states) and a two-step modal: GitHub Star → join Feishu group to apply for a Seedance 2.0 experience Key. Visual style aligned with the prototype in refly-ai/agent-digital-cowork PR #119 and #120. * fix(web): update Seedance tutorial URL to docs.nexu.io * fix(web): resolve biome a11y lint errors in seedance promo
Summary
POST /api/internal/pools/{poolId}/check-slack-tokensendpoint that validates Slack bot tokens viaauth.test, marks invalidones as
error, and triggers config regenerationrunSlackTokenHealthLooptokens_revokedandapp_uninstalledSlack events reactively inslack-events.tstokens_revokedandapp_uninstalledto Slack App manifest bot eventsGatewayLockErrorCrashLoopwaitGatewayReadyto prevent infinite spin when OpenClaw fails to startContext
When a Slack bot token is revoked, OpenClaw crashes on
auth.test()during startup. The sidecar restarts it, but the config stillcontains the dead account, causing a persistent CrashLoop. A separate issue: stale gateway lock files from unclean exits also cause
GatewayLockError→ CrashLoop.This PR adds three layers of defense:
tokens_revoked/app_uninstalledevents trigger immediate cleanupwaitGatewayReadytimeout prevent two other CrashLoop patternsSummary by CodeRabbit
UX Improvements
Reliability Improvements
Documentation