Skip to content

fix(runtimed): loop for automerge sync ack in sync_to_daemon#698

Merged
rgbkrk merged 1 commit intomainfrom
fix/sync-to-daemon-broadcast-loop
Mar 11, 2026
Merged

fix(runtimed): loop for automerge sync ack in sync_to_daemon#698
rgbkrk merged 1 commit intomainfrom
fix/sync-to-daemon-broadcast-loop

Conversation

@rgbkrk
Copy link
Member

@rgbkrk rgbkrk commented Mar 11, 2026

sync_to_daemon previously read exactly one frame after sending the sync message. If a Broadcast frame arrived before the AutomergeSync ack, the broadcast was silently dropped and the ack was left unprocessed in the stream buffer — leaving peer_state stale.

Now loops until the ack arrives (or the 500ms deadline expires), queuing any Broadcast frames in pending_broadcasts for later delivery.

Also adds diagnostic logging to ExecuteCell when a cell is not found, including the doc's cell count and IDs.

Addresses these flaky CI failures:

FAILED test_cell_created_by_one_visible_to_other - Timed out waiting for cell with source visible to s2
FAILED test_interleaved_stdout_stderr_separate - Cell not found in document
FAILED test_uv_inline_deps_trusted - uv:inline requires a prepared environment (was it created?)

All three share the same root cause: sync mutations not propagating because a Broadcast frame ate the AutomergeSync ack.

Supersedes #693 (same fix, rebased onto current main after fractional indexing landed).

PR submitted by @rgbkrk's agent Quill, via Zed

sync_to_daemon previously read exactly one frame after sending the sync
message. If a Broadcast frame arrived before the AutomergeSync ack, the
broadcast was silently dropped and the ack was left unprocessed — leaving
peer_state stale.

Now loops until the ack arrives (or the 500ms deadline expires), queuing
any Broadcast frames in pending_broadcasts for later delivery.

Also adds diagnostic logging to ExecuteCell when a cell is not found,
including the doc's cell count and IDs.
@rgbkrk rgbkrk merged commit b865540 into main Mar 11, 2026
14 checks passed
@rgbkrk rgbkrk deleted the fix/sync-to-daemon-broadcast-loop branch March 11, 2026 16:54
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.

1 participant