Repository navigation
refactor(plugin-sdk): expose reply-session conflict classifier - #109902
k176060444-lgtm wants to merge 1 commit into
Conversation
|
Codex review: blocked before merge. What this changesThis PR exposes a shared reply-session conflict classifier and replaces several channel-local matchers. Example: A Telegram button submits /status, and dispatch throws Error("dispatch wrapper") with cause Error("reply session initialization conflicted for agent:main:telegram:9").
Review scores
ProductKind: Refactor · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain This PR retains useful shared-classifier work absent from current main and the latest stable release; it needs SDK direction and resolution of confirmed merge conflicts. Priority: P2 Decision needed
Before merge
Findings
Tests
Agent review detailsHow this fits togetherReply-session initialization emits concurrency failures; core retry and channel completion owners classify them before retrying, settling ingress, or delivering a terminal notice. flowchart TD
A[Inbound message or callback] --> B[Reply session initialization]
B --> C[Conflict error]
C --> D[Shared classifier]
D --> E[Core retry owner]
D --> F[Channel completion owner]
E --> B
F --> G[Delivery or recorded settlement]
Technical reviewBest possible solution: Publish one owner-approved, documented classifier while preserving current core retry ownership and Discord delivery outcomes. Do we have a high-confidence way to reproduce the issue? Source shows that top-level-only channel matchers miss nested conflicts; supplied Telegram evidence demonstrates recovery for cause and error wrappers, without a new execution during this review. Is this the best way to solve the issue? A shared identity and predicate is the right boundary, but integration should target current consumers rather than restore retired channel retry layers. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 63bd1e92db98. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +96, Tests +458, Generated 0, Other +2. Total +556 across 16 files. Added test files: 2. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (28 earlier review cycles; latest 8 shown)
Reviewed October 12, 2026, 10:47 AM ET / 14:47 UTC (Revision 29). |
9720a83 to
21380d9
Compare
21380d9 to
44c6e75
Compare
44c6e75 to
fa7ecae
Compare
fa7ecae to
a9cfd2c
Compare
a9cfd2c to
835e8d9
Compare
Telegram wrapped reply-session conflict retry — end-to-end evidenceTested PR #109902 at exact head:
A real Telegram inline-button callback was routed through the production plugin-interaction path. The plugin handler returned Three independent runs were performed:
Control runRun ID: Observed:
This establishes that a normal callback does not enter the reply-session conflict retry path. Client screenshot — Control R2
Wrapped
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
26a4313 to
a11ef41
Compare
a11ef41 to
8c0cbec
Compare
|
Thanks for the PR. We're closing older pull requests that have gone stale against current This PR has been waiting on author changes with no commits since August 2, and it was blocked in review. If you'd still like to land a shared reply-session conflict classifier, please open a fresh PR rebased on current main. |



What Problem This Solves
Plugin authors and channel extensions currently duplicate reply-session initialization conflict classification using ad hoc regex and manual error.message checks. Without a shared, stable classifier, any change to the error message breaks hard-to-find classification logic across Discord, Signal, Slack, Telegram, and WhatsApp. The Plugin SDK should expose a single predicate that extensions import and trust.
Summary
isReplySessionInitConflictError(error: unknown)throughopenclaw/plugin-sdk/error-runtime;Telegram, and WhatsApp;
Behavior
The shared predicate recognizes:
ReplySessionInitConflictErrorinstances;causeanderrorchains;It intentionally does not classify name-only or partial-message matches.
This normalizes wrapped-error handling and strict message matching across
channels. Retry counts, backoff, terminal behavior, and user-facing messages
are unchanged (Discord retry was already removed upstream; wrapping now
correctly routes to terminal notice).
Evidence
Unit tests
cause-chain wrapping, error-like objects, no-throw contract, Proxy traps);
Static checks
pnpm tsgo:core— ✅;pnpm check:test-types— ✅;pnpm build:plugin-sdk:strict-smoke— ✅ (4/4 exports);pnpm plugin-sdk:api:check— ✅;pnpm plugin-sdk:surface:check— ✅ (8150 public / 4534 callable);pnpm deadcode:knip— ✅;pnpm deadcode:exports— ✅;pnpm check:import-cycles— 0 cycles;pnpm check:madge-import-cycles— 0 cycles;npx oxfmt --check— 15 files correct;git diff --check— clean.Four unrelated Windows-only failures were reproduced unchanged on the
upstream/main baseline: one SQLite EBUSY cleanup failure and three Telegram
path-separator assertions.
Scope