fix: making typing start fire-and-forget allows cleanup/idle to run before a persistent typin...#75403
Conversation
|
Codex review: needs changes before merge. Reviewed July 3, 2026, 8:41 PM ET / July 4, 2026, 00:41 UTC. Summary PR surface: Source +50, Tests +90. Total +140 across 7 files. Reproducibility: yes. by source inspection. Current main starts typing in the background while Feishu records removable typingState only after addTypingIndicator resolves, so cleanup can call stop before there is state to remove. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof path suggestion Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Land a narrow typing cleanup fix after restoring the pinned Copilot SDK contract and deciding or validating the shared typing-helper duplicate-stop behavior. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection. Current main starts typing in the background while Feishu records removable typingState only after addTypingIndicator resolves, so cleanup can call stop before there is state to remove. Is this the best way to solve the issue? No for the current head. The typing-layer fix is plausible, but the branch must drop unrelated Copilot SDK contract drift before maintainers judge the shared cleanup semantics and Feishu proof gap. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 24dba4b44a5b. Label changesLabel justifications:
Evidence reviewedPR surface: Source +50, Tests +90. Total +140 across 7 files. View PR surface stats
Security concerns:
Acceptance criteria:
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
|
|
🦞🔧 Repair: kept the fix on this contributor branch instead of opening a replacement PR. Current state: exact-head review queued immediately; GitHub checks and the review verdict gate final merge. Automerge progress:
|
f903926 to
a5f5ddb
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
73cb4c5 to
1372565
Compare
|
ClawSweeper status: this ClawSweeper-authored replacement PR is blocked on real behavior proof. Reviewed head: Maintainer decision needed:
|
|
ClawSweeper status: this ClawSweeper-authored replacement PR is blocked on real behavior proof. Reviewed head: Maintainer decision needed:
Possible manual Mantis/desktop proof suggestion: |
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.