Repository navigation
fix(pull): exit 1 when the team repo fetch fails in a pull a person ran - #1512
Merged
SaulMoro merged 1 commit intoOct 28, 2026
Merged
Conversation
pull set exitCode = 1 for a failed team fetch only with a pinned ref or on DetachedRecoveryError, so scripts and CI saw exit 0 after '✖ Pull failed'. A pull started without --silent (and not by a git hook) now exits 1; the silent pulls that session and git hooks run keep exit 0 and keep recording the failure. Refs Tencent#1500 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No findings in the specified PR diff. The PR description satisfies the testing requirement: it records Review was read-only; I did not run, build, or install PR code. |
SaulMoro
approved these changes
Oct 28, 2026
SaulMoro
left a comment
Collaborator
There was a problem hiding this comment.
This was generated by AI during triage.
@pcbeingused333 Thanks, approving dfa535a2.
- A person's pull. With the built CLI and the team remote gone,
teamai pull,pull --force, a user-scope pull and--dry-run pullgo from exit 0 on main to exit 1 here, each with the same✖ [workspace|user] Pull failed: …line. - Hook pulls.
pull --silent,hook-dispatch post-merge --tool gitandhook-dispatch session-start --tool claudestill exit 0, anddoctorstill reportsLast git hook run failed: post-merge could not fetch the team repo. - Internal callers. Only the CLI action sets
interactive, and every internal caller ofpull()passessilent: true, so none of them changes behavior. - Tests. The new e2e test fails on main (
expected +0 to be 1) and passes here, also with a symlinked TMPDIR. The twopull-team-ref-1183cases flip to exit 1, which is what #1500's A1 asks for. On a merge with main (after the oxlint change in #1414), lint andtscpass. CI is green at this head.
The CI review reported no findings and accepted the body's record of the built CLI. We agree. The CHANGELOG.md entry under ### Changed merges cleanly with #1509's.
4 of 5 tasks
3 tasks done
Walternater
pushed a commit
to Walternater/teamai-cli
that referenced
this pull request
Nov 2, 2026
…uns (Tencent#1512) teamai pull exits 1 when the team repo cannot be fetched, as it already did for a pinned ref, so scripts and CI stop on a failed pull. A pull a session hook or git hook runs (--silent) still exits 0 and records the failure as before. Refs Tencent#1500
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
teamai pullexits 1 when the team repo fetch fails and a person ran it. Until now it setexitCode = 1only for a pinned ref or a detached-HEAD recovery, so✖ Pull failed: … does not appear to be a git repositorystill exited 0 and scripts and CI carried on. Hook pulls keep their rule: the silent pull a session hook or git hook runs (--silent, oroptions.gitHook) still exits 0 and records the failure as before.Type of Change
Test Plan
npx tsc --noEmitpassesnpm run lintpasses (0 warnings, 0 errors)npx vitest runpasses — see belowAdded/updated tests for the change
New e2e
src/__tests__/e2e/pull-fetch-failure-exit-1500.test.tsruns the built CLI (dist/index.js): with the team remote removed,teamai pull --forceprintsPull failedand exits 1;teamai pull --silent --forceandhook-dispatch post-merge --tool gitstill exit 0. It fails onmain(exit 0) and passes with the change.pull-team-ref-1183.test.ts: the two cases "keeps an attached unpinned {workspace,user} pull successful when its remote is unavailable" asserted exit 0, which is the behaviour this issue asks to change (A1); they now expect 1 and are renamed.Also run and passing:
source-cache-isolation-e2e,source-shared-destination-e2e,cli-error-exit,push-env.Environment note: everything was run in a Docker
node:22container as root. Six tests inpull-team-ref-1183.test.ts(co-author policy / read-only directory cases) and several unit files (usage-tracking,workflow-*) fail there; the six in the 1183 file fail identically onmainwithout this change. The unit failures were not compared one by one againstmain, so CI is the check for the full unit suite.Real-CLI record (built CLI, isolated HOME, team remote redirected to a missing path through
url.<path>.insteadOf),npm run buildthennpx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/pull-fetch-failure-exit-1500.test.tsat the head commit:The same file on
main:exits 1 for a pull a person ranfails withexpected +0 to be 1; the hook case passes. No separate manual transcript was recorded.Related Issues
Refs #1500 (Part 1, A1 and A2). A3–A5 (
importdeep enrich,init --http) and Parts 2–3 are left for separate PRs.Notes for Reviewers
options.interactive === true && !options.gitHook; the CLI setsinteractivefrom!--silent. A script that runsteamai pull --silenttherefore still exits 0, since--silentis documented as "for hooks" and is what the hooks run. Say if you would rather key this on something else.docs/guide,skill-data, READMEs);CHANGELOG.md### Changedhas an entry.This change was prepared with the help of an AI assistant (Claude); the code and tests were reviewed before submission.