Repository navigation
fix(github): tolerate null check suites on a PR's first tick - #758
Merged
Merged
Conversation
GitHub can return null entries in commit.checkSuites.nodes in a PR's first seconds (no GraphQL error). fingerprintFromRaw read node.id and crashed the first poll tick with "Cannot read properties of null (reading 'id')". Drop unreadable suites at the batch and poll-summary ingestion points and mark the suite page as not fully read, so readiness stays unverified instead of crashing; stack handoff declines pages containing one. The top-level error handler now also appends the stack to the per-worktree debug log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MaU9nzcPYZ2vfLt8UozvDS
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Problem
pr-shepherd 757 --until-terminalcrashed on its first tick (seconds after PR creation) withCannot read properties of null (reading 'id')(exit 70). The savedBatchPrDataresponse hadcommits.nodes[0].commit.checkSuites.nodesending in twonullentries (no GraphQLerrors), alongsidestatusCheckRollup: null.Root cause
suiteFingerprintinsrc/github/fingerprint-fields.mts:28readnode.idon a null suite, called fromfingerprintFromRaw(src/github/fingerprint.mts:76) infetchGraphqlPrBatch(src/github/batch.mts:78). Replaying the saved response throughmain()with a local wire server reproduced the exact stack. OthercheckSuitesconsumers (parseHeadWorkflowSuites, poll-summary unreported/startup checks, stack handoff) would dereference the same null.Fix
dropUnreadableSuites(src/github/check-suite-nodes.mts): a null suite is unknown data, so it is dropped (no values invented) and the suite page is markedhasNextPage: true. Existing consumers already treat an unread suite page as unverified (checkSuitesCompletefalse, summaryincomplete), so readiness fails closed instead of crashing.requireRawPr(batch) andhydratePollSummaryChecks(poll summary). Stack handoff declines a layer whose suites contain a null and falls back toBatchPr.src/index.mts) now also appends the stack (and cause chain) to the per-worktree debug log. Terminal output is unchanged; no-op when the log is disabled.Tests
src/github/check-suite-nodes.test.mts: unit tests plus a batch-path regression (requireRawPr+fingerprintFromRaw) that throws the originalTypeErrorwithout the fix.indexstack-logging cases.vitest run: only the known local-onlyload.cascade/load.mergefailures. Lint, typecheck, and format:check clean.docs: n/a (no output shape change).
🤖 Generated with Claude Code
https://claude.ai/code/session_01MaU9nzcPYZ2vfLt8UozvDS