-
Notifications
You must be signed in to change notification settings - Fork 35
fix: replace any types and @ts-ignore in SDK clients #583
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
Open
dev-punia-altimate
wants to merge
1
commit into
main
Choose a base branch
from
proposal/sdk-client-type-safety
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4
−6
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
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.
🧩 Analysis chain
🌐 Web query:
Node.js undici fetch request timeout property type💡 Result:
In Undici's fetch implementation (used in Node.js), there is no direct "timeout" property on the fetch request options (RequestInit). Timeouts are configured via the optional "dispatcher" property, which accepts a Dispatcher instance (e.g., new Agent({ ... })) or similar. The relevant timeout properties on the dispatcher (e.g., Agent or Client constructor options, or DispatchOptions) are of type "number | null": - headersTimeout: number | null (time to receive headers, default 300000 ms) - bodyTimeout: number | null (time between body data, default 300000 ms) - connect.timeout: number (for connection timeout, nested under "connect" option) These are specified in Undici's Dispatcher.DispatchOptions and ClientOptions. Use 0 to disable. For fetch example: fetch(url, { dispatcher: new Agent({ headersTimeout: 10000, bodyTimeout: 10000 }) }) AbortSignal in RequestInit can also be used for overall request abortion, but it's not a numeric timeout property on the request itself.
Citations:
🏁 Script executed:
cat -n packages/sdk/js/src/client.ts | head -30Repository: AltimateAI/altimate-code
Length of output: 1079
🏁 Script executed:
rg "timeout" packages/sdk/js/src/ -A 3 -B 3Repository: AltimateAI/altimate-code
Length of output: 6926
🏁 Script executed:
rg "customFetch" packages/sdk/js/src/ -A 3 -B 3Repository: AltimateAI/altimate-code
Length of output: 1548
🏁 Script executed:
Repository: AltimateAI/altimate-code
Length of output: 1877
🏁 Script executed:
Repository: AltimateAI/altimate-code
Length of output: 713
🏁 Script executed:
Repository: AltimateAI/altimate-code
Length of output: 50
Remove dead code:
timeoutproperty has no effect on Node.js fetch behavior.Setting
timeout = falseon the Request object has no effect in Node.js's undici implementation. Timeouts are configured via:AbortSignalinRequestInit(e.g.,fetch(req, { signal: controller.signal }))dispatcheroption withheadersTimeout/bodyTimeoutpropertiestimeoutproperty on the Request object itselfThe type assertion
Request & { timeout: boolean }masks this non-functional property. This code should either be removed or replaced with proper timeout handling using AbortSignal or dispatcher configuration if timeout control is needed.🤖 Prompt for AI Agents