Repository navigation
fix(workspaces): honor intentional non-git project paths - #13929
oliver-mee wants to merge 3 commits into
Conversation
|
Hey @oliver-mee! Before this PR can be reviewed, a few things need attention: Informational:
Once updated, push a new commit and these checks will re-run automatically. — commitperclip |
|
…ersisted worktrees
A folder-backed project usually gets a `local_path` workspace. When that
folder has no .git, the run fails with `missing_git_metadata` and the only
visible fix is `git init`. Add a hint to that error for `local_path`
workspaces that names the declared non-git source type the product
already offers ("Local non-git path").
Also cover the case where a `non_git_path` workspace has a persisted
`git_worktree` strategy but the realized strategy is not a worktree. The
previous commit already requires git metadata there; this adds the test.
The persisted-strategy test is adapted from paperclipai#8778.
Co-authored-by: Ravi <15770003+raviy06@users.noreply.github.com>
Co-authored-by: simberthon <83401983+simberthon@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The validator tests pass sourceType in directly. This test stores a project workspace row, runs a heartbeat, and checks the result: a non_git_path folder without .git launches, and a local_path folder without .git fails with the non_git_path hint. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
410336a to
6ebc42b
Compare
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
|
Rebased onto current |
|
Thanks @oliver-mee: this was fixed upstream in #15749 (merged 2026-10-13). Master skips the If you're still seeing this problem on current Thank you for the contribution, and sorry it took us a while to get back to you. Generated by Claude Code |
Thinking Path
Linked Issues or Issue Description
Fixes #9824
Supersedes #12205
Supersedes #8778
Refs #7957
Refs #7956
This PR continues #12205 by @raviy06. That PR has a 5/5 Greptile review and green checks. It has had no maintainer review since it opened on 2026-08-26, and it needed a small rebase on current
master.CONTRIBUTING.mdasks contributors to help stalled PRs over the line, so I did that here. The first commit is the #12205 commit, and its author is not changed.Credit: the first commit is by @raviy06 (from #12205). The second commit is by me, with @raviy06 and @simberthon (from #8778) as co-authors. If you squash this PR, please keep these lines in the squash message:
How the three open PRs relate:
sourceTypeof the workspace. It skips only the.gitcheck, and only fornon_git_path, and only when neither the realized nor the persisted strategy isgit_worktree. This PR uses that approach..gitcheck for each workspace that has norepoUrl. That also removes the check for alocal_pathworkspace that points at the wrong folder. The existing test "rejects a workspace-linked issue when adapter cwd has no git metadata" guards that case, so this PR does not use therepoUrlapproach. This PR takes two things from fix(heartbeat): narrow .git requirement to git-backed workspaces (LUN-3022) #8778: its test for a persistedgit_worktreestrategy, and its user case (a plain folder project), which the new error hint below addresses.hasGitMetadataitself. It does not conflict with this PR, and this PR does not include it.What happened?
A local Git-sensitive adapter gets a project workspace with
sourceType: non_git_path. The heartbeat stops before launch withworkspace_validation_failedandmissing_git_metadata, because the folder has no.git.Expected behavior
A declared
non_git_pathworkspace runs without.gitmetadata when the strategy is notgit_worktree. All other workspace checks stay the same.Steps to reproduce
cwdto a folder that is not a Git repository.claude_localorcodex_local.missing_git_metadatabefore the adapter starts.Paperclip version or commit
masterat7b7c4d4172d6. The bug is also onv2026.916.1.What Changed
server/src/services/heartbeat.ts(from fix(workspaces): honor intentional non-git project paths #12205): the resolved workspace now carries the project workspacesourceType. The.gitcheck skips anon_git_pathworkspace when neither the realized nor the persisted strategy isgit_worktree.doc/execution-semantics.md(from fix(workspaces): honor intentional non-git project paths #12205): one line documents thenon_git_pathrule.server/src/services/heartbeat.ts(new): when alocal_pathworkspace has no.git, the error now also says: set the source type tonon_git_path(Local non-git path) if the folder is not meant to be a Git repository. Before this, the only visible fix wasgit init.server/src/__tests__/heartbeat-workspace-session.test.ts: the two fix(workspaces): honor intentional non-git project paths #12205 tests, plus a test for anon_git_pathworkspace with a persistedgit_worktreestrategy (adapted from fix(heartbeat): narrow .git requirement to git-backed workspaces (LUN-3022) #8778), plus a test for the new hint.server/src/__tests__/heartbeat-non-git-path-workspace.test.ts: stores a project workspace row, runs a heartbeat, and checks the result. Anon_git_pathfolder without.gitlaunches. Alocal_pathfolder without.gitfails with the hint.Verification
pnpm --filter @paperclipai/server exec vitest run src/__tests__/heartbeat-workspace-session.test.ts: 160 of 160 pass.pnpm --filter @paperclipai/server exec vitest run src/__tests__/heartbeat-non-git-path-workspace.test.ts: 2 of 2 pass. Control with the heartbeat not passingsourceTypefrom the row: 2 of 2 fail.mastercode with the new tests: 2 fail (thenon_git_pathtest and the hint test).tsc --noEmitinserver: pass.non_git_pathon a non-Git folder, with the fix(workspaces): honor intentional non-git project paths #12205 change applied tov2026.916.1. Localclaude_localruns start in that folder. Before the change, the same runs failed withmissing_git_metadata.Risks
git_worktreestrategy. All other workspace-coherence checks stay the same.non_git_pathon a folder that is really a Git checkout. Then the.gitcheck does not run for that workspace. The user chose this, and the UI labels it clearly.missing_git_metadatadoes not change.Model Used
claude-opus-5-5), 1M context, agentic tool use (shell, file edits, test runs). The model compared the three open PRs, rebased fix(workspaces): honor intentional non-git project paths #12205, wrote the new hint and tests, and wrote this description. A human directed the work and reviewed the result. The fix(workspaces): honor intentional non-git project paths #12205 commit is by its original author.Checklist
Fixes: #/Closes #/Refs #OR (b) described the issue in-PR following the relevant issue template#NNN/github.com/paperclipai/paperclipURLs)docs/...,fix/...) and contains no internal Paperclip ticket id or instance-derived details🤖 Generated with Claude Opus 5.5
🧑💻 Ideated, directed and reviewed by a human, @oliver-mee