Merge pull request #3636 from lucasyounger/codex/fix-3629-worktree-plan-path

fix(boulder): resolve continuation progress from worktree plan
This commit is contained in:
YeonGyu-Kim
2026-05-06 17:15:21 +09:00
committed by GitHub
13 changed files with 252 additions and 21 deletions
@@ -105,6 +105,41 @@ describe("checkCompletionConditions continuation coverage", () => {
expect(result).toBe(true)
})
it("returns true when the mirrored worktree plan is complete even if the main repo plan is stale", async () => {
// given
spyOn(console, "log").mockImplementation(() => {})
const directory = createTempDir()
const mainPlanPath = join(directory, ".sisyphus", "plans", "done-in-worktree-plan.md")
const worktreeDirectory = createTempDir()
const worktreePlanPath = join(worktreeDirectory, ".sisyphus", "plans", "done-in-worktree-plan.md")
mkdirSync(join(directory, ".sisyphus", "plans"), { recursive: true })
mkdirSync(join(worktreeDirectory, ".sisyphus", "plans"), { recursive: true })
writeFileSync(mainPlanPath, "- [ ] stale main repo task\n", "utf-8")
writeFileSync(worktreePlanPath, "- [x] completed worktree task\n", "utf-8")
const sisyphusDir = join(directory, ".sisyphus")
mkdirSync(sisyphusDir, { recursive: true })
writeFileSync(
join(sisyphusDir, "boulder.json"),
JSON.stringify({
active_plan: mainPlanPath,
started_at: new Date().toISOString(),
session_ids: ["test-session"],
plan_name: "done-in-worktree-plan",
agent: "atlas",
worktree_path: worktreeDirectory,
}),
"utf-8",
)
const ctx = createMockContext(directory)
const { checkCompletionConditions } = await import("./completion")
// when
const result = await checkCompletionConditions(ctx)
// then
expect(result).toBe(true)
})
it("returns false when current session is an appended descendant of an active boulder session with unchecked plan items", async () => {
// given
spyOn(console, "log").mockImplementation(() => {})
+2 -2
View File
@@ -1,4 +1,4 @@
import { getPlanProgress, readBoulderState } from "../../features/boulder-state"
import { getPlanProgress, readBoulderState, resolveBoulderPlanPath } from "../../features/boulder-state"
import { getSessionAgent } from "../../features/claude-code-session-state"
import {
getActiveContinuationMarkerReason,
@@ -47,7 +47,7 @@ async function hasActiveBoulderContinuation(
const boulder = readBoulderState(directory)
if (!boulder) return false
const progress = getPlanProgress(boulder.active_plan)
const progress = getPlanProgress(resolveBoulderPlanPath(directory, boulder))
if (progress.isComplete) return false
if (!client) return false