Skip to content

fix: support nested repositories in workspace checkpoints - #1902

Merged
4pmtong merged 2 commits into
mainfrom
fix/nested-repo-workspace-checkpoint
Sep 4, 2026
Merged

fix: support nested repositories in workspace checkpoints#1902
4pmtong merged 2 commits into
mainfrom
fix/nested-repo-workspace-checkpoint

Conversation

@4pmtong

@4pmtong 4pmtong commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Pull Request

Related Issue

Closes #1901

Description

This fixes workspace checkpoint failures after a task clones an independent Git repository inside a Git-managed Space.

Git reports an untracked nested repository as a single directory entry such as ?? child-repository/. The checkpoint path pipeline normalized the corresponding Path to child-repository, causing path_sources validation to fail after the clone had already completed. The tool outcome was then marked unknown and the Run failed.

The parent Content Repository now treats a verified untracked nested Git root as an independent repository boundary. It excludes that boundary from parent checkpoint/status ownership without modifying ignore files or staging an implicit gitlink. Physical worktree cleanliness remains unchanged so isolated worktrees are not cleaned while they contain an unmerged nested repository.

A regression test covers creating a child repository during a broad terminal mutation and verifies that:

  • the parent checkpoint completes without creating a parent commit;
  • parent HEAD, state token, and tracked paths remain unchanged;
  • the child repository and its committed content remain intact;
  • physical worktree safety still detects the nested repository.

Testing Evidence (REQUIRED)

Locally verified command output:

$ uv run --project backend pytest backend/tests/app/workspace_git -q
185 passed in 114.09s

$ uvx ruff check backend/app/workspace_git/backend.py backend/tests/app/workspace_git/test_mutation.py
All checks passed!

$ uvx ruff format --check backend/app/workspace_git/backend.py backend/tests/app/workspace_git/test_mutation.py
2 files already formatted

$ git diff --check
(no output)
  • I have included human-verified testing evidence in this PR.
  • This PR includes frontend/UI changes, and I attached screenshot(s) or screen recording(s).
  • No frontend/UI changes in this PR.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Contribution Guidelines Acknowledgement

@4pmtong
4pmtong merged commit bd46251 into main Sep 4, 2026
10 checks passed
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.

Workspace checkpoint fails after cloning a nested repository

1 participant