Skip to content

fix(workspaces): honor intentional non-git project paths - #13929

Closed
oliver-mee wants to merge 3 commits into
paperclipai:masterfrom
oliver-mee:fix/non-git-path-workspaces
Closed

oliver-mee wants to merge 3 commits into
paperclipai:masterfrom
oliver-mee:fix/non-git-path-workspaces

Conversation

@oliver-mee

@oliver-mee oliver-mee commented Sep 24, 2026 •

Copy link
Copy Markdown

Thinking Path

  • Paperclip is the open source app people use to manage AI agents for work
  • Local adapters run in a project workspace that the heartbeat selects
  • Before launch, the heartbeat checks that a Git-sensitive adapter gets a coherent Git workspace
  • The product also lets users declare a workspace as non_git_path, which the UI calls "Local non-git path: a local folder without git semantics"
  • The check ignores that declaration and requires .git metadata for every project workspace, so these workspaces can never run
  • Three open PRs try to fix parts of this. They stalled, and two of them conflict on one case
  • This pull request carries fix(workspaces): honor intentional non-git project paths #12205 forward on current master, keeps its author, and adds the useful parts of fix(heartbeat): narrow .git requirement to git-backed workspaces (LUN-3022) #8778
  • The benefit is that declared non-git folders run, and Git-backed and worktree workspaces keep their full protection

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.md asks 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:

Co-Authored-By: Sentinel Wright <raviy06@users.noreply.github.com>
Co-authored-by: simberthon <83401983+simberthon@users.noreply.github.com>

How the three open PRs relate:

What happened?

A local Git-sensitive adapter gets a project workspace with sourceType: non_git_path. The heartbeat stops before launch with workspace_validation_failed and missing_git_metadata, because the folder has no .git.

Expected behavior

A declared non_git_path workspace runs without .git metadata when the strategy is not git_worktree. All other workspace checks stay the same.

Steps to reproduce

  1. Create a project workspace. Set the source type to "Local non-git path" and set cwd to a folder that is not a Git repository.
  2. Link an issue to the project and assign it to a local adapter such as claude_local or codex_local.
  3. Start a heartbeat.
  4. The run fails with missing_git_metadata before the adapter starts.

Paperclip version or commit

master at 7b7c4d4172d6. The bug is also on v2026.916.1.

What Changed

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 passing sourceType from the row: 2 of 2 fail.
  • Control on master code with the new tests: 2 fail (the non_git_path test and the hint test).
  • Control with only the fix(workspaces): honor intentional non-git project paths #12205 commit: 1 fails (the hint test).
  • tsc --noEmit in server: pass.
  • In real use: a project workspace declared non_git_path on a non-Git folder, with the fix(workspaces): honor intentional non-git project paths #12205 change applied to v2026.916.1. Local claude_local runs start in that folder. Before the change, the same runs failed with missing_git_metadata.

Risks

  • Low risk. The change skips one check, for one declared source type, and not for any git_worktree strategy. All other workspace-coherence checks stay the same.
  • A user can declare non_git_path on a folder that is really a Git checkout. Then the .git check does not run for that workspace. The user chose this, and the UI labels it clearly.
  • The new hint changes the text of one error message. Code that matches the full message text sees a longer message. The error code missing_git_metadata does not change.

Model Used

Checklist

  • I have included a thinking path that traces from project context to this change
  • I have specified the model used (with version and capability details)
  • I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work
  • I have searched GitHub for duplicate or related PRs and linked them above
  • I have either (a) linked existing issues with Fixes: # / Closes # / Refs # OR (b) described the issue in-PR following the relevant issue template
  • I have not referenced internal/instance-local Paperclip issues or links (only public GitHub #NNN / github.com/paperclipai/paperclip URLs)
  • My branch name describes the change (e.g. docs/..., fix/...) and contains no internal Paperclip ticket id or instance-derived details
  • I have run tests locally and they pass
  • I have added or updated tests where applicable
  • I have updated relevant documentation to reflect my changes
  • I have considered and documented any risks above
  • All Paperclip CI gates are green (not run yet)
  • Greptile is 5/5 with no open P2s, recommendations, or follow-ups (not run yet)
  • I will address all Greptile and reviewer comments before requesting merge

🤖 Generated with Claude Opus 5.5
🧑‍💻 Ideated, directed and reviewed by a human, @oliver-mee

@commitperclip

commitperclip Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Hey @oliver-mee! Before this PR can be reviewed, a few things need attention:

Informational:

  • This branch carries commits by Sentinel Wright. Squash-merging drops that authorship unless the squash message carries their trailers, and nothing else will notice if it does not. Add to the squash body when merging:

    Co-Authored-By: Sentinel Wright <raviy06@users.noreply.github.com>
    

Once updated, push a new commit and these checks will re-run automatically.

— commitperclip

@greptile-apps

greptile-apps Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adds support for intentional non-git project workspaces.

The PR appears safe to merge; no outstanding finding or new actionable issue was identified.

Summary

The PR lets local adapters run in project workspaces declared non_git_path without requiring .git metadata. It retains the Git check for worktree strategies, adds guidance for plain folders declared local_path, and tests resolution from a stored workspace row.

Reviews (4) · Last reviewed commit: "test(workspaces): resolve the source typ..."

raviy06 and others added 3 commits September 25, 2026 12:55
…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>
@oliver-mee
oliver-mee force-pushed the fix/non-git-path-workspaces branch from 410336a to 6ebc42b Compare September 25, 2026 04:56
@greptile-apps

greptile-apps Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Want your agent to iterate on Greptile's feedback? Try greploops.

@oliver-mee

Copy link
Copy Markdown
Author

Rebased onto current master (now at efce9356, "fix(ui): offer recovery when the app fails before React starts", #13970). The commits replayed cleanly with no logic changes. The General tests (chat 1/3) and verify failures from the previous run came from the stale base and pass on this head.

@commitperclip

commitperclip Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

@greptileai

@commitperclip

commitperclip Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Thanks @oliver-mee: this was fixed upstream in #15749 (merged 2026-10-13).

Master skips the .git metadata check for a local-path or non_git_path project workspace that has no repository URL, so a plain folder project no longer fails with missing_git_metadata. The nested git worktree case you mentioned is still tracked separately.

If you're still seeing this problem on current master, please comment here with the details (or open an issue) and we'll gladly reopen it.

Thank you for the contribution, and sorry it took us a while to get back to you.


Generated by Claude Code

@commitperclip commitperclip Bot closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Folder-backed projects without a git repo can never run on local adapters (workspace_validation_failed / missing_git_metadata)

2 participants