Skip to content

fix(slack): prevent bot message authorization from hanging on repeated cursors - #120686

Merged
steipete merged 1 commit into
mainfrom
codex/slack-members-cursor
Aug 8, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/slack-members-cursor

Conversation

@steipete

@steipete steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Related: #120445 (separate Slack directory pagination owner; this change covers channel-member authorization).

What Problem This Solves

Fixes an issue where Slack channel bot messages could stall indefinitely when the channel-member lookup received a repeated or cyclic pagination cursor. The stuck lookup also prevented a later authorization attempt from starting cleanly.

Why This Change Was Made

The Slack plugin already has a canonical cursor paginator that detects repeated cursors, bounds pagination, and is shared by its user and channel resolution flows. Route the channel-member authorization lookup through that same owner-local helper instead of maintaining another unbounded pagination loop. Normal multi-page owner discovery remains supported; failed lookups deny authorization and release their pending cache entry so the next attempt can retry.

User Impact

Slack operators retain normal bot-message authorization across multiple member pages, while malformed pagination can no longer hang message processing indefinitely or poison subsequent authorization attempts.

Evidence

  • Before the fix, the repeated-cursor and cyclic-cursor authorization regressions failed; after the fix, both terminate, deny safely, and allow a clean successful retry.
  • Remote focused Slack authorization and shared-paginator tests: 45 passed.
  • Remote changed-file verification: passed.
  • Independent automated review: clean.
  • Production delta: -4 lines; regression coverage: +53 lines.
  • AI-assisted; independently reviewed.

@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack size: S maintainer Maintainer-authored PR labels Aug 8, 2026
@steipete
steipete marked this pull request as ready for review August 8, 2026 20:13
@clawsweeper clawsweeper Bot added 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 8, 2026
@steipete
steipete merged commit 8c059f9 into main Aug 8, 2026
150 checks passed
@steipete
steipete deleted the codex/slack-members-cursor branch August 8, 2026 20:40
@steipete

steipete commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@clawsweeper clawsweeper Bot added the P2 Normal backlog priority with limited blast radius. label Aug 8, 2026
@clawsweeper

clawsweeper Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

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

ClawSweeper review

What this changes

The PR replaces Slack channel-member authorization’s unbounded pagination loop with the existing bounded cursor helper and adds regressions for repeated/cyclic cursors and retry recovery.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this active, maintainer-labelled PR open for normal owner approval. Source inspection supports the canonical Slack-plugin fix and found no blocking patch defect.

Priority: P2
Reviewed head: 2367b27d62467233b4d874c51bea886b8c553ae6
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small owner-boundary repair with strong source and regression coverage, pending normal maintainer approval.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This maintainer-authored PR includes focused regression and CI evidence; the external-contributor real-behavior-proof gate does not apply.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR includes focused regression and CI evidence; the external-contributor real-behavior-proof gate does not apply.
Evidence reviewed 7 items Current-main defect: Current main retains the hand-rolled loop: a repeated non-empty next cursor is reassigned and re-enters the request loop without a repeat check.
Owner-boundary repair: The PR changes only the channel-member lookup to use the plugin-local shared helper while preserving the existing request arguments and normalized Set result.
Shared paginator contract: The existing helper trims cursors, rejects repeated cursors, and bounds advancing pagination; sibling user, channel, and directory resolvers already use it.
Findings None None.
Security None None.

How this fits together

Slack bot-room authorization queries channel membership to decide whether an incoming bot message is allowed. The shared cursor paginator turns paginated Slack responses into a bounded member set, which then feeds the authorization cache and allow/deny decision.

flowchart LR
  A[Slack bot-room message] --> B[Authorization check]
  B --> C[Channel-members request]
  C --> D[Shared bounded paginator]
  D --> E[Normalized member set]
  E --> F[Authorization cache]
  F --> G[Allow or deny message]
Loading

Decision needed

Question Recommendation
Should the Slack owner approve this maintainer-labelled authorization liveness repair after confirming the current head’s required checks? Approve the focused repair: Accept the shared-paginator reuse after exact-head checks remain green.

Why: The protected maintainer label requires explicit maintainer handling even though the source and regression coverage support the patch.

Before merge

  • Complete next step (P2) - No repair lane is appropriate because this is an active protected maintainer-owned PR awaiting normal approval.
Agent review details

Security

None.

PR surface

Source -4, Tests +53. Total +49 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 12 16 -4
Tests 1 53 0 +53
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 65 16 +49

Review metrics

Metric Value Why it matters
Production versus regression-test delta production +12/-16 (net -4); tests +53/-0 The implementation removes the duplicate pagination loop while adding focused coverage for healthy pagination, cycles, and retry cleanup.

Root-cause cluster

Relationship: canonical
Canonical: #120686
Summary: This PR is the canonical remaining repair for authorization-member pagination; the merged directory repair shares the cursor-liveness invariant but owns a distinct endpoint and flow.

Members:

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

Technical review

Best possible solution:

Merge the focused authorization repair once the Slack owner accepts the exact-head CI state; retain the shared paginator as the sole cursor-termination policy.

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

Yes—source-reproducible with high confidence: returning the same non-empty cursor repeatedly re-enters current main’s member loop, while the added regressions encode the repeated and cyclic cases.

Is this the best way to solve the issue?

Yes. Reusing the existing plugin-local paginator is the narrowest maintainable fix; another authorization-specific cursor guard would duplicate termination policy and drift from sibling resolvers.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This repairs a Slack authorization liveness failure with channel-specific rather than core-runtime blast radius.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR includes focused regression and CI evidence; the external-contributor real-behavior-proof gate does not apply.

Label justifications:

  • P2: This repairs a Slack authorization liveness failure with channel-specific rather than core-runtime blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR includes focused regression and CI evidence; the external-contributor real-behavior-proof gate does not apply.

Evidence

What I checked:

Likely related people:

  • steipete: History attributes the Slack authorization loop and pagination helper lineage to this area, and the current PR is a focused repair there. (role: origin and recent area contributor; confidence: high; commits: 8b665e0d7066, 50a97288dd03, 2367b27d6246; files: extensions/slack/src/monitor/auth.ts, extensions/slack/src/cursor-pages.ts)
  • wanyongstar: Authored the merged directory-pagination repair that confirmed this helper as the shared owner-local solution. (role: adjacent paginator adopter; confidence: medium; commits: 16ab7e8b4ae8; files: extensions/slack/src/directory-live.ts, extensions/slack/src/cursor-pages.ts)

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.

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

Labels

channel: slack Channel integration: slack maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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