feat(typing): Add TTL safety mechanism to prevent stuck typing indica…#27428
Closed
Crpdim wants to merge 1 commit intoopenclaw:mainfrom
Closed
feat(typing): Add TTL safety mechanism to prevent stuck typing indica…#27428Crpdim wants to merge 1 commit intoopenclaw:mainfrom
Crpdim wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Contributor
Greptile SummaryAdds a TTL (Time-To-Live) safety mechanism to typing indicators that auto-stops them after 60 seconds if cleanup isn't triggered normally. This prevents typing indicators from getting stuck indefinitely when session lifecycle fails (e.g., during rate limits, subagent timeouts, or NO_REPLY scenarios). Implementation:
Test Coverage:
Code Quality:
Confidence Score: 5/5
Last reviewed commit: c820e91 |
…tors Add maxDurationMs parameter (default 60s) to createTypingCallbacks() as a defense-in-depth protection against typing indicators getting stuck indefinitely. When typing is started, a TTL timer begins. If onIdle()/onCleanup() is not called within maxDurationMs, the typing indicator is auto-stopped and a warning is logged. This addresses multiple reports of stuck typing indicators: - Discord typing persists after delivery (openclaw#27033) - Typing stuck on NO_REPLY (openclaw#27011) - Discord typing stuck after send (openclaw#26891) - Telegram typing stuck on rate limit (openclaw#27360) Changes: - Add maxDurationMs parameter with 60s default - Add TTL timer management (startTtlTimer/clearTtlTimer) - Auto-stop typing when TTL exceeded with warning log - Add comprehensive TTL test suite (6 new tests) The fix is backward compatible - existing code without maxDurationMs automatically gets the 60s safety protection. Fixes openclaw#27011 Fixes openclaw#27033 Fixes openclaw#26891 Related openclaw#27360 openclaw#27347
06b3781 to
c820e91
Compare
steipete
added a commit
that referenced
this pull request
Feb 26, 2026
…hanks @Crpdim) Co-authored-by: Crpdim <crpdim@users.noreply.github.com>
Contributor
|
Landed on What was landed from this PR:
Original PR commit:
Validation run before landing (
Thanks @Crpdim for the safety-net improvement. |
This was referenced Feb 26, 2026
Closed
Closed
Closed
robbyczgw-cla
pushed a commit
to robbyczgw-cla/openclaw
that referenced
this pull request
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
maxDurationMsparameter tocreateTypingCallbacks()with 60s default TTL; auto-stops typing if cleanup not calledChange Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Before:
After:
maxDurationMs)[typing] TTL exceeded (60000ms), auto-stopping typing indicatorSecurity Impact (required)
No)No)No)No)No)Repro + Verification
Environment
Steps
Expected
Actual
Evidence
typing.test.tsTest output:
✓ auto-stops typing after maxDurationMs
✓ does not auto-stop if idle is called before TTL
✓ uses default 60s TTL when not specified
✓ disables TTL when maxDurationMs is 0
✓ resets TTL timer on restart after idle
Human Verification (required)
Verified scenarios:
Edge cases checked:
What did NOT verify:
Compatibility / Migration
Yes)No)No)Existing code without
maxDurationMsautomatically gets 60s protection. No changes required.Failure Recovery (if this breaks)
maxDurationMs: 0in typing callback creationsrc/channels/typing.tsandsrc/channels/typing.test.tsRisks and Mitigations
Risk: 60s default TTL might be too short for legitimate long-running operations
Risk: Warning logs could be noisy if TTL triggers frequently
Risk: Timer leak if fireStop() throws
AI-Assisted Development 🤖
This PR was vibe-coded with Claude (AI assistant).