Skip to content

Fix 1 problem from the log (tasks) - #270

Merged
danielehrhardt merged 1 commit into
mainfrom
godmode/77-fix-1-problem-from-the-log-tasks
Oct 31, 2026
Merged

danielehrhardt merged 1 commit into
mainfrom
godmode/77-fix-1-problem-from-the-log-tasks

Conversation

@danielehrhardt

Copy link
Copy Markdown
Contributor

I fixed the six "runs without a worktree" warnings. Non-coding tasks in a git repository with no commits now run with an info log line instead of a warning and a notification. Typecheck is clean and tasks.test.ts passes (74 tests), including a new test for this case.

Cause

The workspace folder was a repository that had just been created with git init and had no commits yet. Its master branch had no commit, so there was nothing to branch a worktree from. prepareWorktree then threw "The branch "master" doesn't exist". Non-coding tasks already handled this correctly by working in the folder directly. But each task start logged a warn and sent a "works without its own worktree" notification, which gave six warnings in 20 minutes. The message also pointed at the wrong cause.

Changes

  • packages/core/src/tasks/git.ts: added EmptyRepoError (a GitError). For a local repository, prepareWorktree now checks for any branch after the fetch. If there is none, it throws <path> has no commits yet — commit once so tasks can branch from it.
  • packages/core/src/tasks/service.ts: for non-coding tasks, this case is now an info log with no notification, since working in the folder is all that's possible there. Other worktree failures still warn and notify as before. Coding tasks are blocked as before, but the reason now names the actual problem.
  • packages/core/test/tasks.test.ts: new test with a repository that has no commits. A research task finishes without a worktree and without a warning notification, and a coding task is blocked with "has no commits yet".

Checks

  • I merged origin/main before finishing; it was already up to date.
  • Committed as 56f7ae99.

Nothing for you to do. Once that repository gets its first commit, tasks will get their own worktrees again.


Task #77 · done by Self-Healer with Godmode Bot

@danielehrhardt
danielehrhardt merged commit c2a6252 into main Oct 31, 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.

1 participant