Runs: a hub folder no longer blocks runs in the separate repositories inside it

Retrying the Daily brief (workspace ~/caplens) was refused while a change
run worked in ~/caplens/repos/fix-d, with a message that read as if the
retry reused the next run number. Nested workspaces now overlap only
within one repository, and the refusal names the blocking run's own
workspace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-26 09:36:54 +00:00
parent b023720617
commit 4d86fe5a7f
2 changed files with 56 additions and 2 deletions
+25
View File
@@ -151,3 +151,28 @@ func TestWorkspaceOverlapIncludesParentsDescendantsAndSymlinks(t *testing.T) {
}
}
}
// A hub folder holding separate repositories (the operator's ~/caplens with
// clones under repos/) must not block, nor be blocked by, a run inside one of
// those repositories; the same repository still overlaps itself.
func TestWorkspaceOverlapSeparatesNestedRepositories(t *testing.T) {
hub := t.TempDir()
repo := filepath.Join(hub, "repos", "fix-d")
inner := filepath.Join(repo, "src")
nested := filepath.Join(repo, "vendor", "lib")
for _, dir := range []string{filepath.Join(repo, ".git"), inner, filepath.Join(nested, ".git")} {
if err := os.MkdirAll(dir, 0700); err != nil {
t.Fatal(err)
}
}
for _, pair := range [][2]string{{hub, repo}, {repo, hub}, {hub, inner}, {repo, nested}} {
if workspacesOverlap(pair[0], pair[1]) {
t.Fatal("separate repositories falsely overlap", pair)
}
}
for _, pair := range [][2]string{{repo, repo}, {repo, inner}, {inner, repo}} {
if !workspacesOverlap(pair[0], pair[1]) {
t.Fatal("one repository does not overlap itself", pair)
}
}
}