agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

bug(project import): reported existing repository incorrectly shown as needing git init

Open Pulkit7070 opened this issue 2 months ago • 4 comments

Report: existing repository shown as “Needs git init”

During a real-project desktop test on 2026-09-08, AO's Import an existing project flow (single Git repository mode) displayed Needs git init for an existing local repository. A read-only git -C <selected-folder> rev-parse --verify HEAD succeeded for the same folder.

Environment

Native Electron development app associated with PR #4830, macOS, isolated daemon/data on port 3002, real project folder. Checkout HEAD 8e808a00cf001a9ddfb20c687426e738a261fbbb with pre-existing uncommitted changes; not verified against a released build.

Steps observed

  1. Choose Import an existing project from the home page.
  2. Select a real existing repository through the native folder picker.
  3. The dialog explicitly says Import a single Git repository as one project and displays the selected folder with Needs git init.
  4. Verify .git exists and git rev-parse --verify HEAD succeeds. The notice remained on a subsequent observation.

The user did not proceed with Git initialization; no source-project files were changed.

Expected

Recognize the existing repository. If another prerequisite is missing (such as origin/default-branch configuration), report that prerequisite instead of suggesting Git initialization. While detection is pending, show a pending state rather than a definitive missing-Git diagnosis.

Confidence and limits

Medium confidence in the displayed mismatch; low confidence in its cause. Later computer-control accessibility state and screenshots diverged, so this needs confirmation with a fresh pinned build and captured directory-probe response before changing repository detection. Do not treat the later dialog-control problems as separately confirmed AO bugs.

Inspect single-project probe results, loading/error handling and the mapping to Needs git init in CreateProjectFlow.tsx.

Related but not an exact duplicate: #4959 concerns selecting workspace mode for a single-repository folder. This observation was explicitly in single-project mode. #4679 covers remote-less repositories; a missing remote has not been established as this report's cause.

Priority: medium. No fix or reliable cross-project reproduction is claimed yet.

Pulkit7070 avatar Sep 08 '26 01:09 Pulkit7070

Hey @illegalcall I would want to work on this, please assign me the same if possible

Shreyasnalle avatar Sep 08 '26 06:09 Shreyasnalle

This should be fixed by : https://github.com/Untrivial-ai/agent-orchestrator/pull/5092

neversettle17-101 avatar Sep 08 '26 13:09 neversettle17-101

check if this issue is resolved and close this one

kekubhai avatar Sep 09 '26 19:09 kekubhai

Confirmed against current main (b9601f38c): this stale observation is no longer reproducible, and no additional code change is warranted.

The single-repository import path now waits for POST /api/v1/imports/validate before rendering a diagnosis. The daemon validator directly inspects the selected path and returns root.isRepo, root.hasCommit, root.hasOrigin, explicit required actions, and blocking errors. A repository with a commit and origin proceeds as ready; only a genuinely plain folder receives the git_init action. Probe/API failures go through the error path and are not mapped to “Needs git init.” The literal “Needs git init” label is now confined to workspace scan rows, not the single-repository flow reported here.

Existing regression evidence passes on current main:

cd backend
go test ./internal/service/importer -run "TestValidateProjectImportReadyRepositoryContinues|TestValidateProjectImportPlainFolderNeedsPreparation" -count=1

Result: ok. The ready-repository test creates a real repository with an origin and asserts isRepo + hasCommit + hasOrigin with nextStep=continue; the plain-folder test separately asserts git_init preparation. Closing as already resolved by the newer daemon-backed import validation flow (introduced in #4872 and subsequently finalized in #4945). If this appears again on a current build, please reopen with the /api/v1/imports/validate response requested by the original report.

codebanditssss avatar Sep 20 '26 06:09 codebanditssss