Repository navigation
fix(providers): classify transport errors, honor paired credentials, repair dead tests #1341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ This is a new constant file defining transient network error codes. It's well-documented and properly structured as a shared constant for retry logic. No issues found. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /** | ||
| * Error codes that indicate a transient transport failure (dropped | ||
| * connection, socket reset, connect timeout) rather than a permanent | ||
| * misconfiguration. Shared between `proxy/proxyFetch.ts` (retry gating) and | ||
| * `utils/errorClassifier.ts` (NetworkError classification) so both stay in | ||
| * sync — a second hand-maintained copy would drift the two apart the same | ||
| * way the "5xx literal text vs statusCode" split did. | ||
| * | ||
| * undici's native `fetch()` wraps the real transport failure in | ||
| * `TypeError: fetch failed`, with the actionable code on `error.cause` | ||
| * (sometimes nested another level deep, e.g. a SocketError inside a | ||
| * ConnectTimeoutError) — never on the outer TypeError itself. | ||
| */ | ||
| export const TRANSIENT_NETWORK_CODES: ReadonlySet<string> = new Set([ | ||
| "ECONNRESET", | ||
| "ETIMEDOUT", | ||
| "ECONNREFUSED", | ||
| "EPIPE", | ||
| "UND_ERR_SOCKET", | ||
| "UND_ERR_CONNECT_TIMEOUT", | ||
| ]); |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reviewing provider descriptor changes: The refactoring replaces hardcoded transport error codes with proper TransportErrorType enum values. This improves type safety and maintainability. ✅ All OpenAI errors now use TransportErrorType.OPENAI_* - correct The mapping is comprehensive and consistent. No issues found. |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reviewing error classifier changes: The refactoring adds bounded cause chain walking (MAX_CAUSE_DEPTH = 5) to prevent infinite loops in cyclic error chains. This is a critical safety improvement. However, I need to verify that the bounded depth doesn't miss legitimate deep error chains. Let me check if there are real-world scenarios where ✅ The MAX_CAUSE_DEPTH guard prevents hanging on cycles - excellent defensive programming The implementation looks correct and addresses the cyclic error chain issue mentioned in the PR description. No issues found. |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reviewing provider config changes: The refactoring introduces proper fallback credential handling with satisfiesFallbacks() function. This is a critical improvement for credential resolution. ✅ SatisfiesFallbacks logic correctly handles fallback credentials (e.g., HF -> Hugging Face) The implementation looks correct and addresses the credential fallback issue mentioned in PR #1337. No issues found. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #1903: the hook now records the files that already carry unstaged edits before it formats, and does not re-stage them, so the unstaged hunks of a partly staged file are no longer swept into the commit. Two child-process cases cover it and fail without the change. A partly staged file is still committed exactly as staged, so its unformatted staged hunk can still fail CI's format check; the hook prints a warning.