fix(providers): report a reason code when the GJC watcher fails - #37
Merged
Conversation
Every failure logged one fixed string, so a restart loop produced thousands of identical, unactionable lines: a 14-hour loop on a live host left no record of what broke it. Watcher diagnostics deliberately withhold transcript paths, so the fix is a closed failure vocabulary rather than raw stderr. - fail() takes a reason from a fixed set and attaches it as Error.cause - child exit carries its numeric exit code and signal name - reportFailure logs that cause plus the consecutive-failure run length - the run length resets once a watcher start succeeds Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
devswha
added a commit
that referenced
this pull request
Aug 13, 2026
The repeated-interrupt assertion slept 100ms and then required exactly two recorded interrupts, so a slower runner failed it: PR #37 went red on Node 24 while Node 22 passed on the same commit, and a rerun went green. waitForInterrupt now takes an expected count and polls to the harness deadline, so the test waits on the event it asserts. The equality check still pins exactly two, so an extra interrupt remains a failure. Verified by running the file three times in a row after the change. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.
What changed
fail()now takes a reason from a fixed vocabulary and attaches it asError.causereportFailurelogs that cause together with the consecutive-failure run length, reset once a start succeedsWhy
A watcher restart loop logs one indistinguishable line per cycle. On a live host it ran 1752 cycles over 14.5 hours and left no record of the cause — the failure was only cleared by an unrelated process kill, and by then the evidence was gone.
Raw stderr is not the fix: watcher diagnostics deliberately never expose transcript paths, an invariant locked by
contains callback diagnostics and continues without exposing event paths. A closed reason vocabulary carries no session data and still identifies the failure. Exit code and signal name are numeric/enumerated, so they are safe to attach.Restart backoff already exists (1s doubling to a 30s cap) and is unchanged; only the run length is new, so a stuck loop is visible without counting timestamps.
Tests
each failure mode reports its own reason code and nothing from the frameready timeout and child exit stay distinguishable, exit status includedfailure diagnostics name the reason so a restart loop is diagnosable from logs alonenpm run typecheck,npm run lint,npm run check:identity,npm test(server 907, client 262) all green