Repository navigation
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
@vachmara, Thank you for raising this PR. I have created an internal bug for the review. |
hkt74
left a comment
There was a problem hiding this comment.
Thanks for resolve the last comments quickly, I did a second review using Gemini
Perfect, thank you! Let me know if you need anything else |
hkt74
left a comment
There was a problem hiding this comment.
I did more tests locally with your change and triggered the github actions
- Need to add 'undici' in
rollup.config.mjs- externalDeps - fix the github actions
|
Not sure the coverage CI is related to this change, is everything still okay? |
hkt74
left a comment
There was a problem hiding this comment.
could the coverage CI related to the change in the package.json file?
/home/runner/work/js-genai/js-genai/dist/src/cross/sentencepiece/sentencepiece_model.pb.js
|
Looks to be fixed and released by Google 850f680 |
|
Actually I don't think she did it right. After removing my own jank patch, I am getting the default 5 mins timeout again instead of the custom timeout I set at 30 mins. |
Yes, I confirm that the error is still here. |
🤦♂️ If only she just adopted this PR instead of the global fetch symbol manipulation she was trying to do. |
…x/node-fetch-timeout
… into fix/node-fetch-timeout
|
Hi @vachmara, Thank you for your patience. It looks like this branch currently has merge conflicts that need to be resolved. Could you please update the branch to resolve these conflicts? This will allow us to complete our verification. |
Hi, on it |
|
Updated and tested with both Undici versions on Node v24.13.0 using
Both successfully exceeded Node fetch’s default 300-second timeout. Run with: npx tsx scripts/manual_test_long_timeout.tsI’ll also test the generated |
|
Hi @vachmara, Thank you for your contribution. The changes look good, but npx tsc is currently failing with a TypeScript compilation error in test/unit/api_client_test.ts. Could you please look into it ? Please let us know once updated, and the PR will be reviewed. |
|
oh thx @Varun-S10 should be fixed now |
|
Hi @vachmara, Thank you for your contribution. We have checked the code changes. I will escalate this to the team, and the PR will be reviewed. Thank you for your patience and understanding. |
Fix #712
This pull request updates how the
undiciHTTP client library is managed and integrated in the project, moving it from a direct dependency to a peer dependency, and adds improved Node.js HTTP timeout handling usingundici'sAgent. It also introduces corresponding test coverage for this new behavior.Dependency management:
undiciandundici-typestopeerDependenciesinpackage.json, and marked them as optional inpeerDependenciesMeta. This makes them optional peer dependencies instead of always-installed direct dependencies.Node.js HTTP request improvements:
src/_api_client.ts, updated the request logic to dynamically importundiciand set a customAgentwith timeout options for Node.js environments, improving HTTP timeout handling.Testing:
test/unit/api_client_test.tsto verify that thedispatcherwith timeouts is set on HTTP requests in Node.js, and imported the requiredAgentand types fromundicifor testing.Shout out to @yulisunny for spotting the issue, I tested this on vercel it's working!