Skip to content

fix(auto-reply): guard missing dispatcher getFailedCounts without weakening the SDK type#89318

Merged
clawsweeper[bot] merged 2 commits into
mainfrom
clawsweeper/automerge-openclaw-openclaw-89148
Jun 2, 2026
Merged

fix(auto-reply): guard missing dispatcher getFailedCounts without weakening the SDK type#89318
clawsweeper[bot] merged 2 commits into
mainfrom
clawsweeper/automerge-openclaw-openclaw-89148

Conversation

@clawsweeper
Copy link
Copy Markdown
Contributor

@clawsweeper clawsweeper Bot commented Jun 2, 2026

Makes #89148 merge-ready for the ClawSweeper automerge loop.
The edit pass should inspect the live PR diff, review comments, and failing checks; rebase if needed; keep the contributor branch credited; and stop only when validation is green or an external blocker is proven.

ClawSweeper 🐠 replacement reef notes:

  • Repair fallback: GitHub rejected the repair branch push because it updates workflow files and the ClawSweeper app token does not have workflows permission

Inherited issue-closing references from the source PR:
Fixes #89116

Co-author credit kept:

fish notes: model gpt-5.5, reasoning high; reviewed against 0bdfb4a.

Alix-007 and others added 2 commits June 2, 2026 04:04
…kening the SDK type

getDispatcherFinalOutcomeCounts called dispatcher.getFailedCounts()
without optional chaining while the adjacent getCancelledCounts?.() was
guarded, so dispatcher variants omitting getFailedCounts threw
"TypeError: dispatcher.getFailedCounts is not a function".

Keep the public ReplyDispatcher.getFailedCounts contract required (no
plugin-facing SDK break) and add an internal DispatcherOutcomeCountsView
plus a readDispatcherFailedCounts helper for the defensive accounting
paths in core dispatch (dispatch-from-config, dispatch-acp-delivery) and
the Feishu extension bot, each falling back to zero counts when a
non-conforming runtime dispatcher omits the method.

Fixes #89116

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@clawsweeper clawsweeper Bot added channel: feishu Channel integration: feishu size: S clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge proof: supplied External PR includes structured after-fix real behavior proof. proof: sufficient ClawSweeper judged the real behavior proof convincing. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. clawsweeper Tracked by ClawSweeper automation labels Jun 2, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor Author

clawsweeper Bot commented Jun 2, 2026

Codex review: passed. Reviewed June 2, 2026, 12:16 AM ET / 04:16 UTC.

Summary
Adds defensive failed-count reads in auto-reply/ACP accounting and Feishu fallback paths, plus a focused regression test, while keeping ReplyDispatcher.getFailedCounts required.

PR surface: Source +24, Tests +35. Total +59 across 5 files.

Reproducibility: yes. from source inspection. Current main calls dispatcher.getFailedCounts().final and sibling Feishu/ACP paths call getFailedCounts() directly, so a runtime dispatcher missing that method follows a clear TypeError path; the source PR also supplied terminal before/after proof.

Review metrics: 1 noteworthy metric.

  • Dispatcher API surface: 0 public fields changed; 1 internal counts view added. This matters because the reported crash needs tolerant runtime accounting, but changing the exported dispatcher contract would be plugin SDK compatibility risk.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Next step before merge

  • [P2] No repair lane is needed; review findings are empty and the opted-in PR can proceed through automerge or maintainer landing gates.

Security
Cleared: The diff only changes TypeScript dispatcher count reads and a focused test; it does not add dependency, CI, secret, install, workflow, or code-execution surface.

Review details

Best possible solution:

Land the narrow internal guard with the focused regression coverage while keeping the plugin-facing dispatcher API unchanged.

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

Yes from source inspection. Current main calls dispatcher.getFailedCounts().final and sibling Feishu/ACP paths call getFailedCounts() directly, so a runtime dispatcher missing that method follows a clear TypeError path; the source PR also supplied terminal before/after proof.

Is this the best way to solve the issue?

Yes. The PR fixes the crash at the internal count-reading boundary and covers sibling direct call sites without weakening the SDK-visible ReplyDispatcher type.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against ffbd02fe8ed9.

Label changes

Label justifications:

  • P1: The PR fixes a reported auto-reply/Feishu dispatch crash affecting real users on the latest release.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 🚀 automerge armed: This PR is in ClawSweeper's automerge lane. Sufficient (terminal): The linked source PR body includes after-fix terminal proof against the production helper plus focused Vitest/Feishu output, and the replacement head has a successful Real behavior proof check.
  • proof: sufficient: Contributor real behavior proof is sufficient. The linked source PR body includes after-fix terminal proof against the production helper plus focused Vitest/Feishu output, and the replacement head has a successful Real behavior proof check.
Evidence reviewed

PR surface:

Source +24, Tests +35. Total +59 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 4 31 7 +24
Tests 1 35 0 +35
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 66 7 +59

What I checked:

  • Repository policy read: Root policy and the extensions scoped policy were read; the relevant guidance is to review beyond the diff and treat plugin SDK compatibility as upgrade-sensitive. (AGENTS.md:1, ffbd02fe8ed9)
  • Scoped extensions policy read: The Feishu path is under extensions/, whose scoped policy keeps plugin code on SDK/local boundaries and treats bundled plugins like third-party plugins. (extensions/AGENTS.md:1, ffbd02fe8ed9)
  • Current-main crash point: Current main calls dispatcher.getFailedCounts().final in final-outcome accounting, so a runtime dispatcher missing the method follows the reported TypeError path. (src/auto-reply/reply/dispatch-from-config.ts:783, ffbd02fe8ed9)
  • SDK-visible contract remains required on main: ReplyDispatcher.getFailedCounts is required in the dispatcher type, and that type is exported through the plugin SDK reply runtime, so making it optional would be a compatibility-sensitive API change. (src/auto-reply/reply/reply-dispatcher.types.ts:18, ffbd02fe8ed9)
  • Plugin SDK export checked: The plugin SDK reply runtime exports ReplyDispatcher, confirming the dispatcher type is plugin-facing. (src/plugin-sdk/reply-runtime.ts:48, ffbd02fe8ed9)
  • PR keeps public type and adds internal view: The PR leaves ReplyDispatcher.getFailedCounts required and adds DispatcherOutcomeCountsView plus readDispatcherFailedCounts for tolerant internal reads. (src/auto-reply/reply/reply-dispatcher.types.ts:22, 0bdfb4adebc6)

Likely related people:

  • Rob Pierson: Remote history shows commit b474f429ee4b added the plugin SDK reply payload hook work and modified dispatch-from-config.ts, dispatch-acp-delivery.ts, and reply-dispatcher.types.ts, including the dispatcher count contract area. (role: introduced dispatcher/counting surface; confidence: high; commits: b474f429ee4b; files: src/auto-reply/reply/dispatch-from-config.ts, src/auto-reply/reply/dispatch-acp-delivery.ts, src/auto-reply/reply/reply-dispatcher.types.ts)
  • ArthurNie: Remote history shows commit 7c15c2765ebb added and refined the Feishu no-visible-reply fallback behavior that contains the two guarded Feishu call sites in this PR. (role: recent Feishu fallback contributor; confidence: high; commits: 7c15c2765ebb; files: extensions/feishu/src/bot.ts, src/auto-reply/reply/dispatch-from-config.ts)
  • Ted Li: Remote history shows recent reply-routing work in dispatch-from-config.ts and dispatch-acp-delivery.ts, making this a useful adjacent routing signal for review or follow-up. (role: recent auto-reply routing contributor; confidence: medium; commits: 6cb06f5fbcf5; files: src/auto-reply/reply/dispatch-from-config.ts, src/auto-reply/reply/dispatch-acp-delivery.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@openclaw-barnacle openclaw-barnacle Bot removed the proof: supplied External PR includes structured after-fix real behavior proof. label Jun 2, 2026
@clawsweeper clawsweeper Bot merged commit 63ed9ad into main Jun 2, 2026
222 of 230 checks passed
@clawsweeper clawsweeper Bot deleted the clawsweeper/automerge-openclaw-openclaw-89148 branch June 2, 2026 04:17
@clawsweeper
Copy link
Copy Markdown
Contributor Author

clawsweeper Bot commented Jun 2, 2026

🦞✅
ClawSweeper merged this PR after the passing review.

Source: clawsweeper[bot]
Feedback: structured ClawSweeper verdict: pass (sha=0bdfb4adebc64c0bf4700516e6d3e118ef6519bd)
Merge status: merged by ClawSweeper automerge
Merged at: 2026-06-02T04:16:58Z
Merge commit: 63ed9adfe90a

What merged:

  • Adds defensive failed-count reads in auto-reply/ACP accounting and Feishu fallback paths, plus a focused regression test, while keeping ReplyDispatcher.getFailedCounts required.
  • PR surface: Source +24, Tests +35. Total +59 across 5 files.
  • Reproducibility: yes. from source inspection. Current main calls dispatcher.getFailedCounts().final and si ... issing that method follows a clear TypeError path; the source PR also supplied terminal before/after proof.

Automerge notes:

  • PR branch already contained follow-up commit before automerge: fix(auto-reply): guard missing dispatcher getFailedCounts without wea…

The automerge loop is complete.

Automerge progress:

  • 2026-06-02 04:16:45 UTC review passed 0bdfb4adebc6 (structured ClawSweeper verdict: pass (sha=0bdfb4adebc64c0bf4700516e6d3e118ef651...)
  • 2026-06-02 04:17:01 UTC merged 0bdfb4adebc6 (merged by ClawSweeper automerge)

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 2, 2026
…kening the SDK type (openclaw#89318)

Summary:
- Adds defensive failed-count reads in auto-reply/ACP accounting and Feishu fallback paths, plus a focused regression test, while keeping `ReplyDispatcher.getFailedCounts` required.
- PR surface: Source +24, Tests +35. Total +59 across 5 files.
- Reproducibility: yes. from source inspection. Current main calls `dispatcher.getFailedCounts().final` and si ... issing that method follows a clear TypeError path; the source PR also supplied terminal before/after proof.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(auto-reply): guard missing dispatcher getFailedCounts without wea…

Validation:
- ClawSweeper review passed for head 0bdfb4a.
- Required merge gates passed before the squash merge.

Prepared head SHA: 0bdfb4a
Review: openclaw#89318 (comment)

Co-authored-by: Alix-007 <li.long15@xydigit.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: takhoffman
Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
SYU8384 pushed a commit to SYU8384/openclaw that referenced this pull request Jun 3, 2026
…kening the SDK type (openclaw#89318)

Summary:
- Adds defensive failed-count reads in auto-reply/ACP accounting and Feishu fallback paths, plus a focused regression test, while keeping `ReplyDispatcher.getFailedCounts` required.
- PR surface: Source +24, Tests +35. Total +59 across 5 files.
- Reproducibility: yes. from source inspection. Current main calls `dispatcher.getFailedCounts().final` and si ... issing that method follows a clear TypeError path; the source PR also supplied terminal before/after proof.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(auto-reply): guard missing dispatcher getFailedCounts without wea…

Validation:
- ClawSweeper review passed for head 0bdfb4a.
- Required merge gates passed before the squash merge.

Prepared head SHA: 0bdfb4a
Review: openclaw#89318 (comment)

Co-authored-by: Alix-007 <li.long15@xydigit.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
Approved-by: takhoffman
Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge clawsweeper Tracked by ClawSweeper automation P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(dispatch): getFailedCounts is not a function - missing optional chaining

1 participant