df0baeff36
Tracked: CLAUDE.md, agents, skills, settings, memory. Ephemeral data (sessions, history, telemetry, tasks) excluded via .gitignore. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.1 KiB
2.1 KiB
Parallel Tasks — Bugs & Fixes (2026-03-18)
Bug 1: Race condition in mergeTaskToDev (CRITICAL — DATA LOSS)
- Fixed in: commit
c2a2901on dev - File:
src/git/WorktreeManager.ts - Root cause: Multiple parallel tasks finishing at same time all call
mergeTaskToDev()which doesgit checkout dev+git merge+git push— but concurrent checkouts corrupt working dir - Fix: Async function with per-tabRoot mutex lock (Promise chain). Push verification before worktree/branch cleanup.
- Evidence: 3 tasks completed ($1.82-$2.43 each) but code lost — git reflog showed only
checkout: moving from dev to devwith no merge commits
Bug 2: Session key collision for parallel worktree tasks
- Fixed in: commit
c2a2901on dev - File:
src/sessions/SessionManager.ts - Root cause: Session key was always
projectId— when multiple tasks share same projectId, each new session kills the previous viakillSession(ctx, projectId) - Fix:
sessionKey = (useWorktree && taskId) ? taskId : projectId— worktree tasks use taskId as key
Bug 3: task:archive only accepted finished tasks
- Fixed in: commit
c2a2901on dev - File:
src/socket/TaskSocketHandlers.ts - Fix: Archive now accepts
finished,stopped,failedstatuses
Bug 4: pushRemote not configured
- Fixed in: commit
c2a2901on dev - File:
config.json - Root cause: No
pushRemotefield, defaulting toorigin(GitHub) instead ofgitea - Fix: Added
"pushRemote": "gitea"to config.json
Bug 5: isTabBusy blocks parallel worktree tasks
- Fixed in: commit
c2a2901on dev - File:
src/socket/TaskSocketHandlers.ts - Root cause:
task:runhandler checksisTabBusy()and returnsqueue-blockedeven for worktree tasks that can run independently - Fix: Added
&& !useWorktreecondition to bypass check for worktree tasks
Key Lesson
- Paralelní tasky s worktree MUSÍ mít:
- Unikátní session key (taskId, ne projectId)
- Serializované merge operace (mutex per tabRoot)
- Push verification před smazáním worktree/branch
- Správný pushRemote (gitea, ne origin)