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

bug(projects): trailing-space paths can import the wrong repository

Open codebanditssss opened this issue 1 month ago • 0 comments

AO trims spaces from the end of a project path. On Linux, those spaces can be part of the folder name, so this can import a different repository.

Repro

  1. Create two separate Git repositories named trailing and trailing, each with an initial commit.
  2. Send the exact path of trailing to POST /api/v1/projects.
  3. Check the returned project path.

AO returns 201 but registers trailing without the space. If that sibling doesn't exist, it rejects the valid repository with NOT_A_GIT_REPO instead.

The selected path should be preserved. normalizePath currently calls strings.TrimSpace before checking the repository.

Test notes: Fedora 44, dd67f2d818. Reproduced through the real daemon API using two disposable repositories with different commits.

codebanditssss avatar Oct 06 '26 18:10 codebanditssss