fix: making typing start fire-and-forget allows cleanup/idle to run before a persistent typin...#75403
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 31, 2026, 1:33 AM ET / 05:33 UTC. Summary PR surface: Source +59, Tests +90. Total +149 across 2 files. Reproducibility: yes. Current main clearly allows cleanup to run before Feishu records typingState, so the first stop can no-op and the later successful start can leave persistent typing behind. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused shared-helper fix after exact-head validation if maintainers accept one final duplicate stop as the cleanup contract for pending persistent starts. Do we have a high-confidence way to reproduce the issue? Yes. Current main clearly allows cleanup to run before Feishu records typingState, so the first stop can no-op and the later successful start can leave persistent typing behind. Is this the best way to solve the issue? Yes, with maintainer acceptance of the compatibility risk. Serializing cleanup in the shared helper is narrower than a Feishu-only patch and keeps typing start off the reply critical path while adding regression coverage. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against bbc4bee7a22b. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +59, Tests +90. Total +149 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
|
🦞🔧 Source: I will update this PR branch, or open a safe credited replacement, if the repair worker finds a narrow fix. Automerge progress:
|
f903926 to
a5f5ddb
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
a5f5ddb to
73cb4c5
Compare
…efore a persistent typin...
…claw-45b86450795d (1)
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
73cb4c5 to
1372565
Compare
|
ClawSweeper status: this ClawSweeper-authored replacement PR is blocked on real behavior proof. Reviewed head: Maintainer decision needed:
|
Summary
Found one concrete regression: making typing start fire-and-forget allows cleanup/idle to run before a persistent typing indicator has finished starting, so the stop path can no-op and leave the indicator behind.
What ClawSweeper Is Fixing
src/channels/typing.ts:79onReplyStartnow startsfireStart()in the background and returns after one microtask atsrc/channels/typing.ts:79-87, whilefireStopimmediately marks the callbacks closed and callsstopatsrc/channels/typing.ts:90-98. For Feishu,startassignstypingStateonly afterawait addTypingIndicator(...)atextensions/feishu/src/reply-dispatcher.ts:176;stopreturns without doing anything iftypingStateis still unset atextensions/feishu/src/reply-dispatcher.ts:183-185. A fast cleanup whileaddTypingIndicatoris still in flight therefore calls stop too early, then the delayed start completes and records a persistent reaction with no later removal.NO_REPLY, empty-message cleanup, cancellation, or send-policy path can leave a visible typing reaction/indicator on the parent message after the run is already finished.stopagain after the promise settles when a start actually completed. Alternatively make persistent-indicator channels expose an abortable/pending-aware start helper.Expected Repair Surface
src/channels/typing.tssrc/auto-reply/reply/typing.tssrc/channels/typing.test.tsSource And Review Context
ClawSweeper report: https://github.com/openclaw/clawsweeper/blob/main/records/openclaw-openclaw/commits/45b86450795d8bd3d1e548c8815cd97d6583199d.md
Commit under review: 45b8645
Latest main at intake: 8093ae6
Original commit author: Ayaan Zaidi
GitHub author: @obviyus
Highest severity: medium
Review confidence: high
Diff:
40b0b1bfe051072f47d0160eb078afa3b17cef48..45b86450795d8bd3d1e548c8815cd97d6583199dChanged files:
src/auto-reply/reply/typing.ts,src/channels/typing.ts,src/channels/typing.test.tsCode read: changed files in full;
src/channels/typing-lifecycle.ts;src/channels/typing-start-guard.ts;src/auto-reply/reply/reply-dispatcher.ts;src/auto-reply/reply/get-reply.ts;src/auto-reply/reply/get-reply-run.ts;src/auto-reply/reply/agent-runner.ts; relevant channel typing call sites, including Feishu, Matrix, Telegram, Discord, Signal, Mattermost, MSTeams, Zalo, and heartbeat typing.Dependencies/web: no dependency files changed; no web lookup needed.
Expected validation
pnpm check:changedClawSweeper already ran:
pnpm installwas needed becausevitest/package.jsonwas missing.pnpm test src/channels/typing.test.ts src/auto-reply/reply/typing-persistence.test.ts src/auto-reply/reply/reply-utils.test.tspassed.pnpm test extensions/feishu/src/reply-dispatcher.test.tspassed.pnpm exec tsx -e ...race probe reproduced the stale persistent-state ordering.Known review limits:
ClawSweeper Guardrails
mainbefore changing code.ClawSweeper 🐠 replacement reef notes:
fish notes: model gpt-5.5, reasoning medium; reviewed against f903926.