Repository navigation
fix(git): bound the team-repo remote calls left on plain git (status, promotion, ls-remote) - #1784
Conversation
The status fetch, the promotion fetch and push, and remoteBranchExists's ls-remote still ran on plain createGit after #1777. A stalled ssh origin held teamai status, the sync lock around recall promote, and the pending push prune forever. Bound them with createGitWithBlockTimeout and --progress; local status/add/commit stay on the plain instance.
|
No findings in the specified PR diff. The PR description satisfies the testing requirement: it records a representative real-CLI run after Review was read-only; I did not run, build, or install anything from the PR. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Approving. I built 6d8b998a and the merge-base (05fe72a2) and ran both against a team remote whose ssh never answers:
teamai status: head exits 0 after 30.2 s with the named stall warning. Base hangs atTeam repo status:and I killed it at 75 s.teamai recall promote: head exits 0 after 180 s with the promotion-fetch warning. Base printed nothing and I killed it at 260 s.TEAMAI_INIT_PUSH_TIMEOUT_MS=3000is honoured. After the head runs, none of the stand-in ssh processes are left.
[P2 non-blocking] The publish-step push (promotion-publish.ts:88-90) now goes through the bounded helper, but no test or run covers it. I checked it only by reading the code.
[P2 non-blocking] src/workflow/cache.ts:873 still runs a plain git.fetch(['origin']) on the team remote, as your Notes say, so a stalled origin can still hang there. That fits a follow-up.
[P3 nit]
git-status-stalled.test.tsalso covers promotion and ls-remote, so its name is narrower than what it tests.- The new cases are skipped on Windows, and no CI job runs a stall there.
- On status and promote, the stall message suggests
TEAMAI_INIT_PUSH_TIMEOUT_MS. The advice works, but the variable has an init-scoped name.
The CI review reports no findings, and I agree.
Merge risk: low
- Alignment: good. It extends #1777's bounded helper to the calls that were left.
- Impact: small. The same commands, and a stall now ends with a message instead of hanging.
- Verification: decent. Before and after on the built CLI for status and promote, and green CI. The publish push was checked only by reading.
- Rollback cost: low.
- Error detection: good.
Summary
#1777bounded the team-repopull/pushhelpers and the side-branch worktrees withcreateGitWithBlockTimeout. Four remote calls were left on plaincreateGit:getRepoStatus()'s fetch — run byteamai status;fetchPromotionRefs()'s fetch — run byrecall promote, under the sync lock;promotion-publish.ts— run byrecall promote --publish;remoteBranchExists()'sls-remote— run while pruning pending pushes (teamai push).With an
ssh://origin that opens the channel and then never writes, each one never returns:teamai statusstops atTeam repo status:, promotion holds the sync lock so later pull/push wait too, andremoteBranchExists'scatchcan never answer.This switches those four calls to
createGitWithBlockTimeout, with--progresson the transfers so a slow but moving transfer keeps resetting the timeout, as#1777does. Local commands stay on the plain instance —getRepoStatus'sstatus(), promotion'sadd/commit— because they print nothing while they work.Type of Change
Test Plan
npx vitest run src/__tests__/git-status-stalled.test.ts— 3 passed (new; reuses the realssh://stand-in fromgit-stalled-remote.test.ts). On the old code the same three cases each time out at 10s.npx tsc --noEmit— passes.npx oxlint --type-aware --deny-warningson the 4 files — 0 warnings, 0 errors.git.test.ts,git-stalled-remote.test.ts,git-process-tree.test.ts,git-kind-reports.test.ts,maintenance-promote.test.ts,maintenance-prune.test.ts,status-*.test.ts,push-pending-pr.test.ts— all pass.Real CLI, after
npm run build, user-scope config pointing at a clone whose origin is the same stalledssh://stand-in (TEAMAI_INIT_PUSH_TIMEOUT_MS=2000):timeout 8 node dist/index.js status→ exit 124, output stops atTeam repo status:(nostalledline);node dist/index.js status→ exit 0 in ~3.2s,⚠ Could not check git status: git fetch --progress stalled: no output for 2s, so teamai ended it and the processes it started. …, then the rest of the report;Team repo status.Related Issues
Related #1749 (closed) — this is the follow-up to #1777, not a reopening.
Notes for Reviewers
pushLearningToOrigin()(no callers today) andworkflow/cache.ts'swithTeamRevisionfetch are the only other plain-git remote calls I found; left out to keep this reviewable.remoteBranchExistsnow answersnullafter the block timeout instead of hanging; its callers already treatnullas "unknown, keep the record".src/utils/git.ts; this branch is a single commit onmain(05fe72a).