Skip to content

fix(slack): repair monitor architecture and lint failures - #150482

Closed
steipete wants to merge 2 commits into
mainfrom
ci-burden/slack-monitor-import-cycle
Closed

steipete wants to merge 2 commits into
mainfrom
ci-burden/slack-monitor-import-cycle

Conversation

@steipete

@steipete steipete commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Related: #150457, #150407

What Problem This Solves

Repairs two Slack regressions that make main CI fail:

User Impact

Preserves temporary authorization retries across restart, terminal rejection of invalid credentials, quiet preamble previews, and approval-request rendering. No configuration or migration changes are required.

Why This Change Was Made

Ingress imported the transient-error classifier from thread resolution, which already imported the ingress lifecycle type. Move the unchanged classifier into the leaf monitor/web-api-errors.ts as isTransientSlackApiError and update ingress, authorization, thread resolution, and existing classifier tests to import it directly.

The separate callback fix invokes progress.progressDraft.pushApprovalEvent(payload) through an arrow function, preserving its receiver, payload, and returned promise. The rest of #150407's changed files contain no other instance introduced by that commit. Both fixes retain the existing lint rules and import-cycle checks; neither adds an exemption.

Evidence

  • Reproduced one Madge cycle before extraction. Both pnpm check:madge-import-cycles and pnpm check:import-cycles pass afterward. The architecture job also passed on the current head.
  • Full Slack monitor suite for the classifier extraction: 60 files, 1,415 tests passed, including all four Keep Slack messages through temporary authorization failures #150457 regressions.
  • node scripts/run-vitest.mjs extensions/slack/src/monitor/message-handler/ after the callback fix: 10 files, 477 tests passed, including immediate approval attention/resolution and quiet preamble preview coverage.
  • oxfmt --check, git diff --check, and pnpm check:line-cap-ratchet --base origin/main passed. No grandfathered file grew; dispatch.ts remains 755 lines.
  • Hosted check-lint passed on the current head, covering the Slack extension with the CI lint pipeline.
  • Fresh pre-commit and full-branch autoreview found no actionable P0/P1 findings.
  • The first commit's changed gate passed both extension typechecks, Doctor contract tests, dead-export scans, and preceding guards. Its remaining database-first, media-download, runtime-sidecar, and runtime-cycle guards passed separately.
  • Local lint remains blocked before analysis: both the changed gate and the CI-style Slack shard (node --import ./scripts/tsx.mjs scripts/run-oxlint-shards.mts --only=extensions:16 --extension-stripe=1/1 --threads=1) reject an ancestor install's node_modules/@types/events/package.json with Declaration input escapes checkout. The task is confined to this nested worktree, so the declaration boundary was preserved. The full local changed gate remains blocked by that checkout layout; hosted lint now supplies passing lint proof for the current head.

Current-head CI: run 35172507267, head d158c583035fe58f60e6a8588daef8e8ef7dacbe.

Requested handoff: PR only; do not merge as part of this task.

…ycle

Extract shared transient Slack Web API error classification into a leaf module used by ingress, thread resolution, and authorization. Preserve temporary authorization failure retries from #150457 while removing the import cycle that fails the main architecture check.
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack size: S maintainer Maintainer-authored PR labels Sep 17, 2026
@fuller-stack-dev fuller-stack-dev self-assigned this Sep 17, 2026
@fuller-stack-dev

fuller-stack-dev commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Continuing the previously adopted native LAND ownership for dependent #110138. I have read back Peter’s new d158c583035fe58f60e6a8588daef8e8ef7dacbe callback fix and will use it directly; no competing source push. Our independent full extraction/callback review found no actionable P0–P2 findings, and our focused classifier, authorization, and ingress-retry run passed 88 tests. The 1,415 monitor tests and 477 dispatch tests in the body remain the author’s reported evidence. Current-head CI and native guards remain required. The original PR-only handoff is complete; this is the already-announced LAND continuation.

@clawsweeper re-review

@fuller-stack-dev

Copy link
Copy Markdown
Member

Coordination: #150026 already published an independently reviewed fix for the same Madge cycle in commit 729eb63a68c71bee56544fb251dbe7d6ab42a56b: move the unchanged private SlackIngressTurnLifecycle type into ingress-lifecycle.ts and update all four consumers. Its required architecture job has passed in run35171480386. Your classifier-leaf extraction is an alternate fix that touches ingress/thread-resolution and the resolver test. I am not editing your branch or starting another Slack implementation. The only currently identified blocker in our run is the Qwen 119999/120000 test-clock race, corrected and reviewed locally as immutable cbec8587a47e091d88f8df9efec9b5f128e926ec, with27 tests and extension-test types passing. Existing canonical coordination is arranging reuse across dependent PRs. I will consume a landed canonical correction and reconcile the overlapping import/type move if necessary, without weakening the checker or duplicating proof.

Restore receiver-preserving invocation of the approval progress method after #150407 replaced its wrapper with an unbound reference. Keep the existing payload and promise result while fixing the check-lint failure.
@clawsweeper

clawsweeper Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 9:55 PM ET / September 17, 2026, 01:55 UTC.

ClawSweeper review

What this changes

The PR moves Slack’s temporary-error classifier into a shared leaf module, removing a static import cycle while preserving authorization and thread-lookup retry behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a focused, maintainer-requested repair that fetched main still needs. No actionable correctness findings remain, and the discussion establishes active landing ownership.

Priority: P3
Reviewed head: 924603cad311b8eeacbf1ed2405a15501f422c99

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving extraction with complete caller migration and relevant validation.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal extraction is exempt from external-contributor runtime proof; the classifier and authority semantics are unchanged, with reported monitor tests and successful architecture CI providing supplemental validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored internal extraction is exempt from external-contributor runtime proof; the classifier and authority semantics are unchanged, with reported monitor tests and successful architecture CI providing supplemental validation.
Evidence reviewed 5 items Verified introduced extraction: The merge-base-to-head diff moves the classifier without changing its body, updates all three production callers and existing test references, and introduces no re-export or checker exemption. The local diff matches the complete host-provided introduction evidence.
Fetched main still needs the repair: Fetched main still imports the classifier from thread resolution into ingress; thread resolution imports the ingress lifecycle type. The architecture checker collects static import declarations, including type imports. Latest-release source inspection could not complete because a required historical object was unavailable; no shipped-fix claim is made.
Private plugin boundary and unchanged authority: Complete ingress, authorization, thread-resolution and classifier modules show unchanged retry decisions and dispatch paths. Slack’s public api.ts does not export this helper, and extensions/AGENTS.md identifies such internal helpers as private. The extraction changes neither public plugin APIs nor authorization authority.
Findings None None.
Security None None.

How this fits together

Slack’s monitor admits incoming events, checks authorization, and resolves message threads before dispatch. Its shared error classifier determines which lookup failures remain eligible for retry.

flowchart LR
  A[Slack events] --> B[Durable ingress]
  B --> C[Authorization and thread lookup]
  C --> D[Shared error classifier]
  D --> E[Retry temporary failures]
  D --> F[Preserve permanent failure handling]
  C --> G[Authorized message dispatch]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +1, Tests -2. Total -1 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 4 52 51 +1
Tests 1 4 6 -2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 56 57 -1

Review metrics

None.

Root-cause cluster

Relationship: canonical
Canonical: #150482
Summary: This PR owns the import-cycle repair; the linked authorization change and dependent integrations address distinct behavior.

Members:

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

Technical review

Best possible solution:

Keep one plugin-local classifier shared by ingress, authorization, and thread resolution, with existing retry semantics intact.

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

Yes: fetched main contains both static import edges, and the inspected architecture checker includes type imports. This review verified the mechanism from source without running the checker.

Is this the best way to solve the issue?

Yes: extracting the unchanged classifier removes the dependency cycle at its owner while preserving callers, tests, and private API boundaries.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 13c6d9e16c1e.

Labels

Label changes:

  • add P3: This is a behavior-preserving internal dependency cleanup with no demonstrated user-facing runtime regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Label justifications:

  • P3: This is a behavior-preserving internal dependency cleanup with no demonstrated user-facing runtime regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

  • Verified introduced extraction: The merge-base-to-head diff moves the classifier without changing its body, updates all three production callers and existing test references, and introduces no re-export or checker exemption. The local diff matches the complete host-provided introduction evidence. (extensions/slack/src/monitor/web-api-errors.ts:14, 924603cad311)
  • Fetched main still needs the repair: Fetched main still imports the classifier from thread resolution into ingress; thread resolution imports the ingress lifecycle type. The architecture checker collects static import declarations, including type imports. Latest-release source inspection could not complete because a required historical object was unavailable; no shipped-fix claim is made. (extensions/slack/src/monitor/ingress.ts:19, 13c6d9e16c1e)
  • Private plugin boundary and unchanged authority: Complete ingress, authorization, thread-resolution and classifier modules show unchanged retry decisions and dispatch paths. Slack’s public api.ts does not export this helper, and extensions/AGENTS.md identifies such internal helpers as private. The extraction changes neither public plugin APIs nor authorization authority. (extensions/slack/src/monitor/ingress.ts:195, 924603cad311)
  • Validation and active ownership: The captured PR body reports zero static/runtime cycles after extraction and 1,415 passing monitor tests. Captured checks show the runtime-topology architecture job succeeded. The member comment explicitly adopts landing ownership and asks to preserve this canonical branch: fix(slack): repair monitor architecture and lint failures #150482 (comment). Tests were not executed during this read-only review. (924603cad311)
  • Feature-history routing: Available history connects Peter Steinberger to durable thread-lookup retries and later ingress settlement, and Vincent Koc to transient member-lookup retries. Missing historical objects prevented complete blame verification, so routing candidates carry no source-line introduction attribution. (extensions/slack/src/monitor/thread-resolution.ts, a0c98de0af86)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 steipete changed the title refactor(slack): break the monitor ingress/thread-resolution import cycle fix(slack): repair monitor architecture and lint failures Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@fuller-stack-dev

Copy link
Copy Markdown
Member

@clawsweeper re-review

Please refresh the existing review for current head d158c583035fe58f60e6a8588daef8e8ef7dacbe, which adds the author’s receiver-bound approval callback fix. The previously announced native LAND continuation is active; no other source changes are planned.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@RomneyDa
RomneyDa disabled auto-merge September 17, 2026 02:03
@fuller-stack-dev

Copy link
Copy Markdown
Member

Closing as superseded by the verified landed correction in #111148 (a13ecd23b32bf8f7aba87b1bb89eafacfee0e5ad, merged 2026-09-17 02:00:41Z), not because of a defect in this patch. Main now extracts SlackIngressTurnLifecycle into the leaf ingress.types.ts and updates every consumer, removing the other edge of the same cycle; it also contains the exact receiver-bound approval callback from this PR.

I acquired current main ead7324bdb36b93a34c3002b398de47b72ab43e9 through native review tooling and verified 0 runtime import cycles and 0 Madge cycles. Those Slack files are unchanged from the landed correction. Peter’s classifier-leaf alternative and callback passed our independent current-head P0–P2 review; 88 focused classifier/authorization/retry tests passed. Both original commits remain published here.

The dependent OpenRouter #110138 continuation now incorporates landed main and contains no Slack diff. The CI watcher stopped on the now-redundant integration conflict; no green result is claimed for that superseded run. Task-owned local checkout cleanup follows; the published branch is retained for contributor recovery.

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 size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants