Repository navigation
fix(integrations): report a stalled response body as a timeout (#176) - #209
Conversation
The 15s fetch signal also bounds reading the body, so a body that stalled after the headers rejected with a TimeoutError that only the fetch call translated. It missed TIMEOUT_MESSAGE and came out with code `failed`. Linear, GitHub and Jira now translate it at every body read, `.text()` on error responses included. A real parse failure behaves as before. Closes #176
There was a problem hiding this comment.
code-reviewer: minor issues
The change wraps every response-body read in the Linear, GitHub and Jira clients so that a TimeoutError raised while reading the body becomes the same did not answer within 15s error as a stalled fetch. Genuine parse failures are still passed through unchanged. The implementation is correct and consistent across the three clients, and the tests pin both the timeout and non-timeout paths for each. I found only two small points: one Linear test sits in the wrong describe, and the changeset's --json claim reaches further than the code does.
Reviewed 9be4e40 for baldurpan · claude-opus-5-5 · 7 files · $0.56
Narrow the release note's --json claim to the reads that end the command.
There was a problem hiding this comment.
code-reviewer follow-up: looks good
Since the last review, the Linear stalled-body test has moved into the fetchLinearIssue block, two startLinearIssue stalled-body cases (read and move) have been added, and the release note now limits its --json claim. Both earlier comments are addressed and nothing new turned up in these changes.
Earlier comments
- Fixed; yours to resolve: Suggestion: fetchLinearIssue stall test sits in startLinearIssue's failures block, without that block's project-file stub
- Fixed; yours to resolve: Suggestion: Release note's
--jsonclaim does not hold for assign/start paths
Reviewed 00f74c7 (changes since 9be4e40) for baldurpan · claude-opus-5-5 · 2 files · $0.14
Closes #176
What changed
The 15s
AbortSignal.timeoutpassed tofetchalso bounds reading the body. Linear, GitHub and Jira translated aTimeoutErroronly at thefetchcall, so a body that stalled after the headers missedTIMEOUT_MESSAGEand came out with codefailed. It now reports<what> did not answer within 15s, as ClickUp has since #175.readBodyrethrows a timeout through a sharedtimeoutError. A real parse failure still returnsundefined.readGitHubBodyorreadJiraBody, and a non-timeout read error is rethrown unchanged..text()on non-OK responses (githubFailure,fetchJiraIssue,jiraAssignFailure), and the assign reads. These had the same defect..changeset/stalled-body-timeout.md,patch, level confirmed by the maintainer.Verification
Gate 1 was run on top of #204, which fixed the
mainfailures in #203.pnpm check,pnpm typecheck,pnpm --filter docs typecheck,pnpm build,pnpm test(2094 passed),pnpm docs:test(69 passed) and the test-markers check all exited 0.pnpm checkwas re-run after the note was added.isTimeoutto true fails exactly the 2 new parse-failure tests. Removing the body-read guards fails 9 stalled-body tests across all three integrations.fetchGitHubLoginagainst a local server that sends headers and half a body, then stalls, givesGitHub: /user did not answer within 15s.for both a 200 and a 500. Linear and Jira are covered by mocks only.Review
The
reviewersubagent returnedFAILon the first pass (no release note; parse failure unpinned for GitHub and Jira), thenPASS WITH NOTESonce both were fixed.Non-blocking behaviour worth reading:
fetchGitHubPullRequestHeadBranchkeeps its catch-all, so a stalled body there gives no suggested branch rather than a timeout. The lookup only improves a refusal message, and a stalledfetchthere was already swallowed the same way. That makes the guard at that read a no-op.readBodyruns before the status check, so a 429 or other non-OK answer whose body stalls now reports a timeout rather than the rate-limit or failed message. No test pins this.branchrecords assignment failures as warnings, so a stalled assign body gets the new message but notimeoutcode. The note's--jsonclaim holds for reads that abort the command.Smaller test gaps from the review: the
/myselfread in Jira assign, some path arguments to the failure helpers,{ cause }, and token absence in the new tests have no assertion of their own.