Repository navigation
test: gate the module-retry test on promises, not timers - #71
Merged
Merged
Conversation
The degraded assertion raced the backoff window: on a slow runner the first /status read arrived after the retry had recovered the module. The third start now waits on a test-held gate, so degraded is stable until read; recovery is observed through the module's own signal. The supervisor still drives the retries — a broken retry times out. Co-authored-by: aivi-agent[bot] <331678708+aivi-agent[bot]@users.noreply.github.com> Harness: OpenCode v2.2.5, mlx-serve/Qwen3.8-Flash-Next-MLX-Serve-iQ-MLX-4.7bpw
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.
The race
a module whose start fails is retried with backoff...fixed the degraded window at ~60 ms (moduleRetry: { baseMs: 20 }) but raced to read/statusafteronReadyby polling every 10 ms. On a loaded runner the boot + poll + fetch overran the window, so the first read saw the module already retried back torunning. Seen on the macOS CI run after the 2.2.5 bump; flaky by construction.The fix
No timing assumptions:
start()awaits a test-held gate, soflakycannot reachrunninguntil the degraded status has been read — the window is open by construction, not by luck.onReadyresolves a promise (raced againsthostso a failed boot fails loudly instead of hanging) — nowhile (!address)poll./statusread (a socket round trip always lands after the supervisor's synchronous write).The supervisor still drives everything the test asserts: the retries fire on its own backoff timer (a broken retry now times out the test), the states,
lastError, andattempts: 3are its output unchanged.npm run agentic:verifyexit 0 locally.