Skip to content

refactor(slack): split message dispatch - #113602

Merged
steipete merged 1 commit into
mainfrom
bench6/slack-dispatch-split
Jul 25, 2026
Merged

steipete merged 1 commit into
mainfrom
bench6/slack-dispatch-split

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Slack message dispatch implementation had grown to 2,395 lines, making its transport ordering, streaming state, and progress-message lifecycle difficult to review and maintain safely.

Why This Change Was Made

This behavior-neutral refactor separates setup, streaming delivery, progress rendering, and shared dispatch helpers into focused modules while keeping the original call order, state ownership, retry/fallback paths, and outbound payload construction intact. Every production module is now below 700 lines, and the obsolete max-lines baseline entry is removed.

User Impact

No user-visible behavior changes. Slack messages, retries, progress updates, streaming delivery, and fallback ordering remain governed by the existing code paths and tests; maintainers get smaller ownership boundaries for future work.

Evidence

@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack size: XL maintainer Maintainer-authored PR labels Jul 25, 2026
@steipete
steipete marked this pull request as ready for review July 25, 2026 10:08
@steipete
steipete force-pushed the bench6/slack-dispatch-split branch from 896700a to 63ddadf Compare July 25, 2026 10:17
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jul 25, 2026
@clawsweeper

clawsweeper Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 25, 2026, 6:21 AM ET / 10:21 UTC.

ClawSweeper review

What this changes

This PR splits Slack inbound message dispatch into setup, streaming delivery, progress rendering, progress I/O, and shared helper modules while preserving the existing reply, retry, and fallback flow.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 5 items remain

Keep this protected maintainer-labeled Slack refactor open for normal maintainer review. The branch has focused test and changed-gate evidence, but it moves message setup, streaming, progress receipts, and fallback delivery across new modules without after-fix real Slack behavior proof.

Priority: P3
Reviewed head: 63ddadffb3d64ed070a8a6178b0e2a6a4a239774
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The refactor appears focused and well-validated by tests, but merge confidence is capped until the external Slack delivery behavior is observed on the final head.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR supplies focused tests and CI gates, but no after-fix run in a real Slack setup; add a redacted live transcript, terminal output, recording, or runtime logs that show the changed delivery flow. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR supplies focused tests and CI gates, but no after-fix run in a real Slack setup; add a redacted live transcript, terminal output, recording, or runtime logs that show the changed delivery flow. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 4 items Refactor boundary: The branch reduces the main dispatcher to orchestration and extracts setup, streaming, progress, rendering, I/O, and helper responsibilities into dedicated Slack message-handler modules.
Delivery-sensitive modules: The extracted streaming runtime retains reply delivery, stream fallback, native progress stream, and message-sent hook responsibilities, so behavior verification needs to cover a real Slack delivery path rather than tests alone.
Submitted validation: The PR body reports 135 focused Slack tests plus changed-gate, lint, typecheck, import-cycle, and unused-export checks on the final head. Those provide useful regression coverage but are not observed after-fix Slack transport proof.
Findings None None.
Security None None.

How this fits together

Slack inbound events are prepared into a dispatch setup, then drive agent replies, streaming previews, progress updates, and final delivery back through Slack. This refactor reorganizes that delivery pipeline without changing its intended transport contract.

flowchart LR
  A[Slack inbound event] --> B[Message preparation]
  B --> C[Dispatch setup]
  C --> D[Agent reply pipeline]
  D --> E[Streaming and progress updates]
  E --> F[Final Slack delivery]
  F --> G[Hooks and delivery tracking]
Loading

Decision needed

Question Recommendation
Does the Slack owner accept the delivery-pipeline split after reviewing a current-head real Slack transcript or equivalent redacted runtime proof? Request live delivery proof: Ask for a redacted Slack run showing streaming or progress updates followed by the final reply on the current head before merging.

Why: The patch is intentionally behavior-neutral but moves transport-ordering and fallback responsibilities across several modules; automated tests cannot fully establish the external Slack delivery contract.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR supplies focused tests and CI gates, but no after-fix run in a real Slack setup; add a redacted live transcript, terminal output, recording, or runtime logs that show the changed delivery flow. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P2) - Merging reorganizes Slack reply ordering, preview streaming, progress receipt collapse, fallback delivery, and sent-message hooks; the supplied evidence does not yet show an after-fix delivery in a real Slack workspace.
  • Resolve merge risk (P1) - The PR is behind current main. GitHub reports it cleanly mergeable, so this is a review-refresh concern rather than evidence that it would remove current-main behavior.
  • Complete next step (P2) - The protected maintainer label and the missing real Slack delivery proof require Slack-owner review rather than an automated repair.
Agent review details

Security

None.

PR surface

Source +321, Other -1. Total +320 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 7 2176 1855 +321
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 8 2176 1856 +320

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Add redacted Slack runtime proof (recommended)
    Capture a current-head Slack message flow that exercises streaming or progress updates and confirms the final reply and fallback lifecycle remain intact.
  2. Accept integration risk after owner review
    A Slack-area reviewer may accept the remaining transport integration risk based on the focused regression suite and changed gate.

Technical review

Best possible solution:

Rebase or refresh against current main as needed, then attach a redacted real Slack run that demonstrates one streaming/progress path and its final delivered reply before maintainer merge review.

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

Not applicable: this PR claims a behavior-neutral refactor, so the relevant verification is parity of real Slack delivery rather than reproduction of a reported defect.

Is this the best way to solve the issue?

Unclear: splitting the dispatcher into ownership-focused modules is a maintainable direction, but the best implementation claim still needs real current-head Slack delivery evidence across the extracted streaming and progress boundary.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is behavior-neutral maintainability work rather than a reported user-facing regression.
  • add merge-risk: 🚨 message-delivery: The refactor moves the Slack reply, streaming, progress, retry, and fallback delivery lifecycle across module boundaries.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR supplies focused tests and CI gates, but no after-fix run in a real Slack setup; add a redacted live transcript, terminal output, recording, or runtime logs that show the changed delivery flow. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P3: This is behavior-neutral maintainability work rather than a reported user-facing regression.
  • merge-risk: 🚨 message-delivery: The refactor moves the Slack reply, streaming, progress, retry, and fallback delivery lifecycle across module boundaries.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR supplies focused tests and CI gates, but no after-fix run in a real Slack setup; add a redacted live transcript, terminal output, recording, or runtime logs that show the changed delivery flow. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the current focused Slack dispatch refactor and supplied the final-head Slack validation evidence; historical ownership could not be established confidently from the available read-only inspection. (role: recent Slack dispatch contributor; confidence: low; commits: 63ddadffb3d6; files: extensions/slack/src/monitor/message-handler/dispatch.ts, extensions/slack/src/monitor/message-handler/dispatch-streaming.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add redacted current-head Slack delivery evidence for streaming or progress updates through final reply delivery.
  • Refresh the branch against current main before the final owner review if the base remains behind.

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

Copy link
Copy Markdown
Contributor Author

Maintainer decision on the ClawSweeper rank-up moves:

ClawSweeper reported no actionable code or security findings and rated patch quality 4/6. The optional live-proof rank-up is intentionally skipped under the maintainer-granted Slack refactor authority.

@steipete
steipete merged commit 64daf8d into main Jul 25, 2026
144 of 145 checks passed
@steipete
steipete deleted the bench6/slack-dispatch-split branch July 25, 2026 10:43
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant