Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 4:43 AM ET / 08:43 UTC. ClawSweeper reviewWhat this changesThe branch gives Slack presence polling a dedicated timeout-bound lookup client, handles rate-limit backoff without losing the polling cursor, and aborts an in-flight lookup during provider shutdown. Merge readinessKeep this PR open for normal maintainer review. Current main still leaves a stalled Slack presence request inside the monitor’s active task, while this branch bounds the request, preserves polling progress across rate limits, and aborts the lookup transport before provider shutdown waits; the patch has no supported correctness finding. Priority: P1 Review scores
Verification
How this fits togetherThe Slack plugin observes eligible conversation participants and periodically calls Slack’s presence API to emit away-to-active events. The provider owns the Slack SDK client lifecycle, while the presence monitor owns serial polling progress and the task that shutdown waits to settle. flowchart LR
A[Slack messages] --> B[Presence target registry]
B --> C[Presence monitor]
C --> D[Dedicated Slack lookup client]
D --> E[Slack presence API]
E --> F[Presence transition event]
G[Provider shutdown] --> H[Abort in-flight lookup]
H --> C
Before merge
Agent review detailsSecurityNone. PR surfaceSource +65, Tests +203. Total +268 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the bounded, lookup-only client design after refreshing against current main and confirming the focused presence-monitor and provider-shutdown regressions still pass; keep the shared Bolt client unchanged for mutation traffic. Do we have a high-confidence way to reproduce the issue? Yes. The supplied current-main run documents that a never-resolving first Slack lookup prevents the next user from polling and leaves both polling and stop unsettled; current source confirms that active task is awaited without a request deadline. Is this the best way to solve the issue? Yes. A separate read-only lookup client is the narrowest maintainable fix because it can enforce timeout and lifecycle cancellation without changing the shared Bolt client’s mutation behavior or public configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0cad02313a9c. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
084b3d6 to
7365dbf
Compare
|
Merged via squash.
|
…-state-mutation * origin/main: (22 commits) fix(delivery): renew stable producer leases (#118663) test(mcp): isolate catalog size checks from wall-clock load (#118871) test(ui): add credentials primary QA proof (#118790) fix(slack): prevent stalled presence polling from hanging shutdown (#117478) test(security): cover gateway shared auth modes (#118834) fix(macos): show gateway auth failures in app status (#118841) test(tui): route PTY gateway scenarios through explicit models (#118802) test(qa): add session transcript primary coverage (#118820) fix(browser): protect private observation media and Canvas trust boundaries (#118775) fix(build): restore SDK packages and signed macOS app builds (#118833) test(qa): cover plugin authoring contracts (#118821) fix(parallels): keep provider keys out of POSIX job logs (#118840) improve: reduce redundant Code Mode test work (#118815) fix(models): report primary OpenRouter limits in scans (#110855) test: speed up setup inference fixtures (#118811) fix(auto-reply): enforce canonical reset authorization (#118580) docs(gateway): fix invalid heartbeat visibility examples (#118827) fix(plugins): unify HTTP route conflict handling (#118203) test(agents): use prepared auth fixtures (#118816) fix(lmstudio): resolve JIT embedding variants ...
…penclaw#117478) * fix(slack): prevent presence polling from hanging shutdown * fix(slack): honor presence polling rate limits * fix(slack): preserve presence polling cursor on rate limits
What Problem This Solves
Fixes an issue where Slack presence polling could freeze permanently when a
users.getPresencerequest never returned. One stalled user prevented later users from being polled, and provider shutdown could remain blocked indefinitely.Why This Change Was Made
Each presence lookup now has a 30-second monitor deadline and runs through a dedicated no-retry lookup client with a matching SDK transport timeout. The monitor stops the current batch on Slack rate limits and suppresses later polls through
Retry-After. Provider teardown aborts the lookup client's in-flight fetch before waiting for the monitor, while the shared Bolt client remains timeout-free because it also carries mutation requests.Root Cause and Design Boundary
Classification: root-cause fix. The presence monitor owns serial per-user progress and the task awaited by
stop(), while the provider owns the Slack SDK transport lifecycle. Bounding only the outer promise would leave the socket alive; setting a timeout on the shared Bolt client would also change mutation behavior. The dedicated lookup client therefore applies real transport cancellation, and the monitor applies the same deadline to guarantee bounded task settlement.The 30-second value is inherited from the existing canonical Slack read-client timeout in
resolveSlackReadClientOptions: both paths are read-only Web API calls with the same stalled-transport failure semantics. It also remains below the 60-second presence polling cadence. Slack's server-providedRetry-Afterremains authoritative for rate limits; the fix adds no independent retry policy value.Compatibility and scope: this changes no public API, config schema, protocol, token selection, authorization decision, or message/write retry behavior. The shared mutation-capable Bolt client, Enterprise Grid presence availability, presence eligibility, greeting, and cooldown behavior remain unchanged. A fresh broad open-PR scan found no semantically equivalent Slack presence deadline or shutdown fix; recalled timeout PRs were in unrelated owners and runtimes.
Merge risk is limited to Slack presence availability and provider cleanup. The dedicated client reuses the same token, proxy dispatcher, Slack API URL, and read timeout policy; focused tests and the real-SDK live proof cover continuity, rate limits, shutdown, and socket cleanup.
User Impact
Slack presence transitions continue polling after a stalled lookup, and stopping or restarting the Slack provider no longer waits forever on that request.
Evidence
Fresh
origin/mainat1130f30445c4c5b5f242d2423061844e6f6e5949still reproduced the bug before submission:Near-real proof used the real
@slack/web-apiclient against a loopback Slack HTTP API. The first scenario withheld response headers for U0001; the second aborted a stalled request at the provider shutdown boundary:Regression and repository checks:
presence-monitor.test.ts: 11 passed, including Retry-After batch and interval suppressionprovider.auth-test-token.test.ts: 22 passed, including the real stalled-socket shutdown regressionoxfmt --check: 26,802 files matched