Skip to content

fix(auto-reply): retry reply-session init CAS conflicts with backoff - #105754

Merged
steipete merged 4 commits into
openclaw:mainfrom
oabdelmaksoud:fix/session-init-conflict-backoff-retry
Jul 13, 2026
Merged

steipete merged 4 commits into
openclaw:mainfrom
oabdelmaksoud:fix/session-init-conflict-backoff-retry

Conversation

@oabdelmaksoud

@oabdelmaksoud oabdelmaksoud commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #102400.

Reply-session initialization retried a lost optimistic-concurrency commit once, immediately, inside the session-store writer lane. A second revision race escaped as reply session initialization conflicted, dropping inbound work on callers without a channel-level replay path.

Why This Change Was Made

The retry belongs at initSessionState, the shared owner for every inbound path. The change keeps the existing immediate stale-snapshot retry, then retries the unlocked outer attempt up to five times with the shared jittered exponential-backoff implementation. Each attempt rereads current state; no backoff holds the session-store writer lane.

The maintainer refresh also makes the wait abort-aware, uses the initializer's single canonical signal throughout commit and retry cancellation, and isolates the typed conflict/retry policy in a production-owned module. Non-conflict failures still escape immediately.

Persistent conflicts caused by stale active-session state remain a separate recovery mode tracked by #101920; this PR handles bounded transient compare-and-swap races before that recovery path should run.

User Impact

Transient session-init races no longer silently drop webchat, Slack, heartbeat, Discord, or other shared inbound work. Shutdown and turn cancellation interrupt an active retry delay instead of waiting or starting another attempt.

Evidence

  • Exact reviewed head: fa78b6fe5e3d70a82fe0966f36057559309f530d
  • Blacksmith Testbox tbx_01kxdtn1tvse42mvwf6whkgq2e: 4 focused files, 166/166 tests; tsgo:core; check:test-types; dead-export baseline; targeted oxlint; full build. Run 29253923193
  • Exact-head hosted CI: 45 successful jobs, 11 skipped, no failures. Run 29255054803
  • Fresh whole-branch maintainer autoreview: clean, confidence 0.94.
  • Contributor field validation: no repeat conflicts across later gateway restarts after applying the equivalent backoff. Issue proof

Copilot AI review requested due to automatic review settings July 12, 2026 23:35
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jul 12, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb60485220

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/auto-reply/reply/session.ts Outdated
log.debug(
`reply session initialization conflicted; retrying in ${backoffMs}ms (attempt ${attemptIndex + 2}/${maxAttempts})`,
);
await sleep(backoffMs);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make session-init retry backoff abort-aware

When a reply run is canceled or the gateway is shutting down while this helper is between CAS-conflict attempts, this await sleep(...) cannot be interrupted and the loop does not check signal before starting the next attempt. get-reply.ts passes the reply abort signal into initSessionState as signal, so a canceled inbound turn can wait through the backoff and then still initialize/commit a session if the next attempt succeeds, instead of bailing immediately; please race the delay and/or the next iteration against the abort signal.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses reply-session initialization CAS conflicts by making session-init conflicts explicitly typed and retryable with exponential backoff, so non-Telegram inbound paths no longer drop events when concurrent writers are updating the same session key.

Changes:

  • Introduces ReplySessionInitConflictError and throws it at the CAS-failure site after the existing stale-snapshot fast retry.
  • Adds runWithSessionInitConflictRetry (jittered exponential backoff) and wraps initSessionState so all inbound paths benefit.
  • Adds focused unit tests covering retry, exhaustion, abort behavior, and backoff bounds.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/auto-reply/reply/session.ts Adds typed conflict error + retry helper and wires it into initSessionState; updates CAS-failure throw site.
src/auto-reply/reply/session.init-conflict-retry.test.ts Adds unit tests validating conflict retry semantics and backoff schedule.

Comment thread src/auto-reply/reply/session.ts Outdated
Comment on lines +398 to +403
const sleep =
options?.sleep ??
((ms: number) =>
new Promise<void>((resolve) => {
setTimeout(resolve, ms);
}));
Comment thread src/auto-reply/reply/session.ts Outdated
log.debug(
`reply session initialization conflicted; retrying in ${backoffMs}ms (attempt ${attemptIndex + 2}/${maxAttempts})`,
);
await sleep(backoffMs);
Comment thread src/auto-reply/reply/session.ts Outdated
Comment on lines +375 to +378
const SESSION_INIT_CONFLICT_MAX_ATTEMPTS = 5;
const SESSION_INIT_CONFLICT_BASE_BACKOFF_MS = 250;
const SESSION_INIT_CONFLICT_MAX_BACKOFF_MS = 4000;
const SESSION_INIT_CONFLICT_JITTER_MS = 100;
@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. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jul 12, 2026
@clawsweeper

clawsweeper Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 12, 2026, 7:57 PM ET / 23:57 UTC.

Summary
Adds typed reply-session CAS conflict errors and retries the unlocked session-initialization attempt with jittered exponential backoff, plus focused helper tests.

PR surface: Source +71, Tests +99. Total +170 across 2 files.

Reproducibility: yes. at source level: current main performs an initial CAS plus one immediate stale-snapshot retry and then throws, while the canonical issue supplies redacted Slack, WebChat, and heartbeat failure logs. A deterministic live concurrent-writer reproduction was not run during this read-only review.

Review metrics: 1 noteworthy metric.

  • Default retry envelope: 5 total attempts; 4 waits at 250, 500, 1000, and 2000 ms plus jitter. This bounds ordinary recovery latency but also defines when a non-spooled inbound event can still fail after sustained contention.

Stored data model
Persistent data-model change detected: serialized state: src/auto-reply/reply/session.init-conflict-retry.test.ts, serialized state: src/auto-reply/reply/session.ts, unknown-data-model-change: src/auto-reply/reply/session.init-conflict-retry.test.ts, unknown-data-model-change: src/auto-reply/reply/session.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #102400
Summary: This PR is a candidate source-level fix for the canonical issue describing silently dropped Slack, WebChat, and heartbeat events after reply-session CAS conflicts.

Members:

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

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until stronger real behavior proof is added.

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

Rank-up moves:

  • [P1] Make the retry delay abort-aware and add an abort-during-sleep regression test.
  • Attach redacted before/after runtime logs or a reproducible concurrent-writer transcript from the exact patched revision.
  • Refresh the branch against current main and revalidate the focused session suites.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The production-gateway claim is relevant but lacks an inspectable redacted before/after log or reproducible live transcript showing the conflict race and the patched recovery; add that evidence, update the PR body to trigger review, or ask a maintainer for @clawsweeper re-review.

Risk before merge

  • [P1] A cancellation or gateway shutdown during backoff can still be followed by another initialization attempt and session-state commit.
  • [P1] The bounded five-attempt policy eventually rethrows the conflict, so non-spooled paths can still discard an inbound event during sustained contention; maintainers should explicitly accept that residual delivery behavior.
  • [P1] The production validation is descriptive rather than an inspectable before/after artifact, leaving the cross-channel and restart-race improvement insufficiently demonstrated.
  • [P1] The branch is behind current main, so the final patch must be refreshed against the newer session lifecycle and store-writer changes before merge.

Maintainer options:

  1. Fix cancellation and prove the race (recommended)
    Make the sleep and post-sleep transition abort-aware, add an abort-during-backoff regression test, refresh onto current main, and attach redacted before/after runtime evidence.
  2. Accept bounded delivery risk
    Merge only after maintainers explicitly accept that conflicts surviving all attempts can still fail a non-spooled inbound event.
  3. Pause for durable recovery
    Pause this PR if the product guarantee requires re-enqueue or coalescing rather than probabilistic bounded recovery.

Next step before merge

  • [P1] The author has a concrete abort-handling fix and proof follow-up, but maintainer confirmation is needed for the bounded-retry versus durable-delivery policy before merge.

Maintainer decision needed

  • Question: Should all inbound paths treat session-init CAS conflicts as a bounded transient retry at the common session layer, accepting an error after exhaustion, or must message-bearing paths durably re-enqueue until delivery is resolved?
  • Rationale: The common retry removes channel asymmetry with minimal duplication, but its exhaustion behavior can still silently lose a non-spooled inbound event; source inspection cannot determine the intended delivery guarantee.
  • Likely owner: obviyus — The most directly related current-main work established the source-side serialization boundary that this retry extends.
  • Options:
    • Bounded common retry (recommended): Use the common unlocked retry, fix abort handling, and explicitly accept that sustained conflicts can still return an error after five attempts.
    • Durable inbound recovery: Require message-bearing callers to spool or re-enqueue exhausted conflicts so an inbound event is not discarded after the bounded source retry.

Security
Cleared: The two-file patch adds no dependency, workflow, permission, secret, artifact-download, package-resolution, or other concrete security or supply-chain concern.

Review findings

  • [P2] Stop retries when cancellation occurs during backoff — src/auto-reply/reply/session.ts:426
Review details

Best possible solution:

Keep the retry at the common unlocked session-init boundary, make both the delay and next iteration abort-aware, add regression coverage for aborting during sleep, and obtain maintainer confirmation that bounded retry rather than durable re-enqueue is the intended residual-delivery policy.

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

Yes at source level: current main performs an initial CAS plus one immediate stale-snapshot retry and then throws, while the canonical issue supplies redacted Slack, WebChat, and heartbeat failure logs. A deterministic live concurrent-writer reproduction was not run during this read-only review.

Is this the best way to solve the issue?

Mostly yes: a common unlocked retry is narrower and more maintainable than duplicating recovery in every channel, but it is not merge-ready until cancellation is honored during backoff and maintainers confirm the intended behavior after retry exhaustion.

Full review comments:

  • [P2] Stop retries when cancellation occurs during backoff — src/auto-reply/reply/session.ts:426
    The signal is checked only while handling the conflict, before this delay. If the reply is canceled or the gateway starts shutting down during sleep, the timer completes and the loop invokes attempt() again, allowing session initialization to commit after cancellation. Make the default wait abortable and check the signal again before the next attempt; add a test that aborts while the sleep promise is pending.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P1: The PR targets a current multi-channel workflow where real inbound messages can be silently discarded during session initialization conflicts.
  • add merge-risk: 🚨 message-delivery: The selected bounded exhaustion policy determines whether a contended non-spooled inbound event is still dropped after all retry attempts.
  • add merge-risk: 🚨 session-state: The patch can initialize and commit session state after the caller aborts while the retry helper is sleeping.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The production-gateway claim is relevant but lacks an inspectable redacted before/after log or reproducible live transcript showing the conflict race and the patched recovery; add that evidence, update the PR body to trigger review, or ask a maintainer for @clawsweeper re-review.

Label justifications:

  • P1: The PR targets a current multi-channel workflow where real inbound messages can be silently discarded during session initialization conflicts.
  • merge-risk: 🚨 session-state: The patch can initialize and commit session state after the caller aborts while the retry helper is sleeping.
  • merge-risk: 🚨 message-delivery: The selected bounded exhaustion policy determines whether a contended non-spooled inbound event is still dropped after all retry attempts.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The production-gateway claim is relevant but lacks an inspectable redacted before/after log or reproducible live transcript showing the conflict race and the patched recovery; add that evidence, update the PR body to trigger review, or ask a maintainer for @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +71, Tests +99. Total +170 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 73 2 +71
Tests 1 99 0 +99
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 172 2 +170

What I checked:

  • Current-main behavior: Current main serializes snapshot and commit through the store writer lane, but a second failed CAS still throws reply session initialization conflicted, so the cross-process or external-writer failure remains possible. (github.com) (src/auto-reply/reply/session.ts:2892, f87492539ba2)
  • Patch cancellation gap: The new helper checks the abort signal when handling the conflict, then awaits an ordinary timer and immediately loops; the existing Codex and Copilot reviews independently identified that cancellation during this wait does not stop the next attempt. (src/auto-reply/reply/session.ts:426, bb6048522035)
  • Observed user impact: The canonical issue documents the same conflict escaping from Slack, WebChat, and heartbeat paths and records silently discarded inbound events on OpenClaw 2026.6.11. (github.com) (src/auto-reply/reply/session.ts:2892, f87492539ba2)
  • Sibling recovery behavior: The canonical issue shows Telegram already classifies this exact conflict message as transient and retries its spooled update with backoff, supporting retryability while also showing that channel-level durable recovery has different delivery guarantees. (github.com)
  • Feature history: The session module history shows sustained ownership by steipete and adjacent lifecycle work by vincentkoc; related current-main serialization work is attributed to obviyus in commit d2da8c7. (github.com) (src/auto-reply/reply/session.ts:2892, d2da8c79d9b8)
  • Proof limitation: The PR body reports a production gateway running an equivalent patch without further conflicts, but provides no attached before/after logs, runtime transcript, exact patched revision, observation duration, or reproducible concurrent-race artifact. (bb6048522035)

Likely related people:

  • obviyus: Related recent work serialized reply-session initialization across the session accessor and writer paths, making this contributor the clearest routing candidate for the remaining CAS-conflict semantics. (role: introduced source-side serialization behavior; confidence: high; commits: d2da8c79d9b8; files: src/auto-reply/reply/session.ts, src/config/sessions/session-accessor.ts, src/shared/store-writer-queue.ts)
  • steipete: The session module history shows repeated refactors and behavioral fixes in this central initialization and lifecycle surface. (role: recent area contributor and merger; confidence: medium; commits: 10b89a3, 4f31cbb, 0e1f53f; files: src/auto-reply/reply/session.ts)
  • vincentkoc: Recent session rollover cleanup and several lifecycle-related changes touch the same module and its side-effect ordering. (role: adjacent session lifecycle contributor; confidence: medium; commits: bf0d2d7, 8ec838a, f630e8d; files: src/auto-reply/reply/session.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.

oabdelmaksoud and others added 3 commits July 13, 2026 13:52
Reply-session initialization retried a lost optimistic-concurrency commit
exactly once, with no delay, inside the store writer lane. When another
writer (restart recovery, a concurrent dashboard tab, an active reply run)
was mid-commit on the same session key, both attempts lost the revision CAS
within milliseconds and "reply session initialization conflicted" escaped to
the caller — silently dropping the inbound event on webchat/Slack/heartbeat
paths (openclaw#102400).

Introduce a typed ReplySessionInitConflictError and retry the whole unlocked
init attempt up to 5 times with jittered exponential backoff (250ms..4s).
The sleep happens outside runExclusiveSessionStoreWrite so the writer lane
is never held while waiting, each retry re-reads a fresh snapshot, and the
error message shape is preserved for channel monitors (e.g. the Telegram
poller) that already classify it as retryable.

Fixes openclaw#102400
@steipete
steipete force-pushed the fix/session-init-conflict-backoff-retry branch from bb60485 to c5a3dd7 Compare July 13, 2026 13:10
@openclaw-barnacle openclaw-barnacle Bot added size: M and removed size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 13, 2026
@steipete

Copy link
Copy Markdown
Contributor

Land-ready maintainer refresh at fa78b6fe5e3d70a82fe0966f36057559309f530d.

  • Shared ownership: initSessionState now performs bounded typed-conflict retry outside the session-store writer lane; session-init-conflict-retry.ts owns the shared backoff and abort contract.
  • Cancellation: the initializer's canonical signal reaches both the commit attempt and sleepWithAbort, preventing a post-abort retry.
  • Regression proof: Blacksmith Testbox tbx_01kxdtn1tvse42mvwf6whkgq2e passed 166/166 focused tests, pnpm tsgo:core, pnpm check:test-types, pnpm deadcode:exports, targeted oxlint, and pnpm build (run 29253923193).
  • Exact-head hosted CI: 45 successful jobs, 11 skipped, no failures (run 29255054803).
  • Fresh whole-branch autoreview: no actionable findings, confidence 0.94.
  • Contributor field proof remains linked in the PR body.

Known boundary: persistent stale-active-session conflicts remain separate #101920 work. That fenced recovery should run only after this bounded transient retry exhausts.

@steipete
steipete merged commit 101b601 into openclaw:main Jul 13, 2026
115 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

nicknmorty added a commit to nicknmorty/openclaw that referenced this pull request Jul 13, 2026
…ter backoff exhaustion

Layer the openclaw#101909 fenced self-heal behind upstream openclaw#105754's typed-error backoff: while runWithSessionInitConflictRetry owns the retry budget, a repeated commit conflict propagates as ReplySessionInitConflictError (conflict-backoff) so transient races settle with no side effects. Only when the jittered backoff exhausts does initSessionState re-enter the attempt with selfHealRequested=true, unlocking the existing fenced recovery: revalidate the candidate under the store writer, drain foreign work admissions via interruptSessionWorkAdmissions outside the store-write lock, dispose the wedged session's MCP runtime, run harness reset hooks, and retry init exactly once (bounded by recoveryAttempted) before failing with clear context. Upstream retry semantics, abort handling, and the load-bearing conflict message shape are preserved.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 14, 2026
…penclaw#105754)

* fix(auto-reply): retry reply-session init CAS conflicts with backoff

Reply-session initialization retried a lost optimistic-concurrency commit
exactly once, with no delay, inside the store writer lane. When another
writer (restart recovery, a concurrent dashboard tab, an active reply run)
was mid-commit on the same session key, both attempts lost the revision CAS
within milliseconds and "reply session initialization conflicted" escaped to
the caller — silently dropping the inbound event on webchat/Slack/heartbeat
paths (openclaw#102400).

Introduce a typed ReplySessionInitConflictError and retry the whole unlocked
init attempt up to 5 times with jittered exponential backoff (250ms..4s).
The sleep happens outside runExclusiveSessionStoreWrite so the writer lane
is never held while waiting, each retry re-reads a fresh snapshot, and the
error message shape is preserved for channel monitors (e.g. the Telegram
poller) that already classify it as retryable.

Fixes openclaw#102400

* fix(auto-reply): cancel conflict backoff on abort

* refactor(auto-reply): unify session init cancellation

* refactor(auto-reply): isolate session conflict retry

---------

Co-authored-by: oabdelmaksoud <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
AsaBizanjo added a commit to msc-project-2026/real-time-agent-collab that referenced this pull request Jul 23, 2026
…it conflicts

The previous digest (pinned 2026-07-13 01:18 UTC) predates upstream's
reply-session-init CAS retry (openclaw/openclaw#105754, merged later that
day) and the session-storage rework that followed. On that build, a session
that loses the identity CAS wedges permanently — every Webex message in the
room fails with "reply session initialization conflicted" (~15ms, no
backoff) until the gateway restarts. Matches upstream issue #102020;
maintainers verified the wedge is gone on current main (~2026-07-20).

New digest is latest-browser 2026.6.34, built 2026-07-22. Also gitignore
*.bak for local backup copies.

Co-Authored-By: Claude Fable 5 <[email protected]>
k176060444-lgtm pushed a commit to k176060444-lgtm/openclaw that referenced this pull request Aug 2, 2026
After shared-core retry exhausts (openclaw#105754), QQBot was silently
swallowing the ReplySessionInitConflictError at two levels:

1. outbound-dispatch.ts catch block consumed all errors from
   dispatchPromise without re-throwing any.
2. gateway.ts handleMessage catch only logged the error without
   sending a user-visible notice.

This change makes dispatchOutbound re-throw only the reply-session
init conflict so gateway.ts can surface a terminal Chinese-language
notice to the user with an 8-char hex error reference number.

The terminal notice is best-effort: QQBot currently has no durable
spool or replay-claim system, so a failed notice delivery is logged
at 'terminal_notice_failed' and the message is not falsely marked
delivered. Durable ingress/replay is deferred to a follow-up PR.

Uses the same message-regex pattern as Discord/Slack/Telegram/Signal
since ReplySessionInitConflictError is not exported through the
plugin SDK.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M 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.

Reply-session init conflict is silently dropped on Slack/webchat/heartbeat inbound, though Telegram already treats it as retryable

3 participants