Skip to content

fix: fail closed unresolved watch chats#131

Merged
steipete merged 1 commit into
mainfrom
fix/watch-unresolved-chat
May 28, 2026
Merged

fix: fail closed unresolved watch chats#131
steipete merged 1 commit into
mainfrom
fix/watch-unresolved-chat

Conversation

@steipete
Copy link
Copy Markdown
Collaborator

Summary

  • retry watch rows when all-chat polling sees a message before chat_message_join metadata exists
  • stop the retry loop from advancing past that unresolved row until it resolves or exhausts the retry budget
  • drop persistently unresolved rows fail-closed instead of emitting chat_id=0 DM-shaped payloads

Fixes #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

@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 28, 2026

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.

Copy link
Copy Markdown

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

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: 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".

Comment on lines +272 to +273
if attempts <= Self.unresolvedChatRetryLimit {
schedulePoll()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@steipete steipete merged commit 6c0fc17 into main May 28, 2026
2 checks passed
@steipete steipete deleted the fix/watch-unresolved-chat branch May 28, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

watch.subscribe can report group link-preview messages as chat_id=0 DM-shaped payloads

1 participant