Repository navigation
fix(contracts): preserve trailing spaces in task folder repository paths - #47733
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — The contracts now preserve edge whitespace in task-folder repository paths and VCS status working directories while still rejecting blank values. This is a narrow path-handling correction with no product-default changes or obvious material operational risk. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Adding a repository whose folder name ends in a space now worked, but its row in thread details read "Not a Git repository": the status request trimmed the worktree path to a folder that does not exist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dismissing prior approval to re-evaluate 59e78d6
EvidenceOn each fresh database, create real main-branch Git repositories space-repro, api, and 'repo ' (one trailing space), register api and 'repo ' as tracked folders, open the project, use New worktree with only api selected, and send 'hello' with Replay (dev) Showcase. After the turn finishes, open Other repositories... and select repo. Capture the settled result. On head, also inspect Git status, verify the stored repositoryPath and worktreePath retain the trailing space, check the checkout's real Git branch, and reload the thread. Environment for all captures: real Linux web app in Chromium, 1280×800, light theme, isolated fresh server state on each commit. Scenario: Adding a tracked repository preserves its trailing space and Git statusProven: the scenario fails on base f3e735b5cf and passes on head 59e78d6239.
Scenario source · Before recording · After recording Head's repo row shows the same task branch as api and Publish repository; it remains correct after reload. The orange branch-title warning is present on both commits because the scenario runner disables real text generation; it is independent of the repository-path behavior. Not shown:
|





Problem
Adding a tracked Git repository whose directory ends in a space to an existing task folder fails because the add request trims the path before matching it against the project. Reading task-folder repository records also trims the repository and checkout paths.
Deterministic repro on
origin/main(9c846a85f35c0467c5a418e67727611363a1efb2): On POSIX with dependencies installed, downloadreproduce.mjsfrom the evidence gist to your current directory, then run from the checkout root:The fixture creates an isolated project with two tracked Git repositories,
apiandrepo, then launches a worktree thread with onlyapiselected. The web/desktop and mobile repository pickers useworkspace.listFoldersandaddableTaskFolderRepositoriesto pass the exact second path toworkspace.addTaskFolderRepository. The fixture follows that same RPC path:TaskFolders.addRepositorycompares resolved paths, creates the Git checkout, and writes it throughTaskFolderStore;workspace.taskFolderreads that record back for the repository rows."/tmp/fixture/repo" is not a tracked folder of the project.and creates no checkout. A stored repository entry with"/tmp/workspace/repo "and"/tmp/task/repo "also decodes without the spaces.workspace.taskFolderreturns those same paths from storage.Change
Use
NonBlankStringfor the add request's repository path and the stored and returned repository and checkout paths, matching the tracked-folder schemas. The RPC, SQLite codec, and shared client already use these contracts, so web, desktop, and mobile need no separate changes to the add flow.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
TaskFolderStore, covering encode and decode. The targeted test file passed all 8 tests.proof, with both literal paths intact in the response and SQLite-backed read-back. Run the same fixture on the fixed commit withEXPECT=fixed.vp run check:changedexited 0: format, lint, Knip, typecheck across 39 packages, and 10 tests in 2 files.Authored by GPT-6.2 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).