agent-orchestrator
agent-orchestrator copied to clipboard
bug(projects): trailing-space paths can import the wrong repository
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
- Create two separate Git repositories named
trailingandtrailing, each with an initial commit. - Send the exact path of
trailingtoPOST /api/v1/projects. - 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.