fix: fail closed unresolved watch chats#131
Conversation
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix: fail closed unresolved watch chats This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c18707a686
ℹ️ 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".
| if attempts <= Self.unresolvedChatRetryLimit { | ||
| schedulePoll() |
There was a problem hiding this comment.
Avoid exhausting retries with zero debounce
When callers configure no debounce, this retry loop becomes effectively immediate: watchDebounceIntervalParam accepts debounce_ms values >= 0, and the CLI parser also accepts --debounce 0ms, so schedulePoll() requeues another poll with no delay until the 20-attempt budget is spent. In that configuration a row whose chat_message_join appears a few milliseconds later is dropped fail-closed before Messages has time to resolve the chat metadata, which reintroduces missed live messages for low-latency watch/RPC users; use a minimum retry delay or wall-clock retry window independent of the event debounce.
Useful? React with 👍 / 👎.
Summary
chat_message_joinmetadata existschat_id=0DM-shaped payloadsFixes #118.
Proof
swift test --filter 'MessageWatcherTests|RPCServerTests'make lint(passes; existing warning-only lint debt remains)/Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --mode local --parallel-tests "swift test --filter 'MessageWatcherTests|RPCServerTests'"clean