Repository navigation
fix(import): time out stalled GitLab MR requests - #1243
Merged
Merged
Conversation
Signed-off-by: ydflow <[email protected]>
|
No findings in the specified PR diff. The PR description documents sufficient testing, including a built, real-CLI E2E run with the unmodified 30-second deadline that verifies batch continuation and failure reporting. This satisfies the repository’s testing requirement. Review was read-only; I did not run, build, or install anything from the PR. |
jeff-r2026
approved these changes
Oct 21, 2026
7 of 8 tasks
Walternater
pushed a commit
to Walternater/teamai-cli
that referenced
this pull request
Nov 2, 2026
Signed-off-by: ydflow <[email protected]> Co-authored-by: ydflow <[email protected]>
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.
Summary
GitLab MR import has no application-level request deadline: none of its
fetchcalls supplies one. A slow or unfinished response can hold up the batch and prevent the existing nonfatal commits, diff and review-thread handlers from continuing promptly. Transport inactivity timeouts do not provide a total deadline for a response that keeps sending data.Give each request, including each discussion page, a fresh 30-second
AbortSignal.timeout. It covers response-body reads as well as waiting for headers. Metadata failures still fail that MR; optional-data failures keep their existing fallback behavior. Add the deadline and fallback rules to the English and Chinese knowledge guides.Type of Change
Test Plan
Local environment: Windows, Node 24.19.0; based on upstream
8487c34d1013f52a232199492a489fea63217de2.npm run buildnpx tsc --noEmitnpm run lintnpx vitest run src/__tests__/gitlab-mr-timeout.test.ts src/__tests__/gitlab-mr-discussions.test.ts src/__tests__/import-mr.test.ts src/__tests__/import-mr-threads.test.ts src/__tests__/github-mr-fetch.test.ts --maxWorkers=2— 47 tests passed across 5 files.npx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/gitlab-mr-timeout.test.ts --maxWorkers=1after the build — 1 test passed, about 30.4 seconds.git diff --checknpx vitest run --maxWorkers=4, then stopped after failures outside this change. Seven selected failures were reproduced in a separate clean worktree at the upstream base above: token mode assertions, symlink EPERM, skill installation and write-only env-file assertions inlocal-agent.test.ts/env-loader.test.ts. Other full-suite failures were not exhaustively diagnosed. This is not a claim that the Windows full suite passes; Linux/macOS remain for CI.The regression tests use a loopback HTTP server that either withholds headers or sends an unfinished JSON body for metadata, commits, diff, first-page discussions and second-page discussions. They shorten the native timeout for speed while asserting every configured deadline is 30,000 ms. Before the production fix, all five endpoint cases failed because the import did not settle.
The real-CLI E2E uses the unmodified 30-second production deadline, with no mocked fetch or shortened timer. MR 41 sends an incomplete metadata body; after cancellation the built CLI requests MR 42 (404), reports
0 succeeded, 2 failed, exits 1, never reaches AI analysis, and creates no learning output. No live GitLab service or model credentials are needed.Related Issues
Discovered from the current source; no matching issue or fix was found in the open PR list and GitLab/timeout searches at submission time.
Notes for Reviewers
The deadline is per API request, not a total deadline for the import. No automatic retries or new CLI flags are added. Existing host validation, manual redirects and optional-data fallback policies are unchanged.