feat: Phase 7a - FileLockManager for parallel agent file coordination#12351
Closed
roomote-v0[bot] wants to merge 2 commits into
Closed
feat: Phase 7a - FileLockManager for parallel agent file coordination#12351roomote-v0[bot] wants to merge 2 commits into
roomote-v0[bot] wants to merge 2 commits into
Conversation
2 tasks
41623ea to
0d89703
Compare
…coordination Advisory file-level locking so concurrent tasks coordinate write access safely. - FileLockManager class with acquire/release/releaseAll operations - Per-file locks with automatic expiration (configurable timeout, default 2min) - Re-entrant lock support (same task can re-acquire its own lock) - Lock conflict detection with detailed conflict info - Event system for lock lifecycle (acquired/released/expired) - Reverse index for efficient per-task lock lookup - Path normalization for consistent lock keys - 39 comprehensive unit tests covering all operations Part of Phase 7 (Controlled Write Parallelism) for Issue #12330
0d89703 to
9ab2c19
Compare
|
@roomote please check is any unit test error |
Contributor
Author
All 39 unit tests pass with no errors ( Note: There is a pre-existing TypeScript error in |
Contributor
Author
Fixed the TypeScript errors in |
- Add missing closing brace for permissions property in new_task.ts - Add task_queue, permissions, background to required array (strict mode) - Consolidate duplicate new_task entries in NativeToolArgs (tools.ts) - Consolidate duplicate params entries in NewTaskToolUse (tools.ts)
Contributor
Author
|
Closing this draft PR as the work has been consolidated into #12356. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related GitHub Issue
Closes: #12330
Description
This PR attempts to address Issue #12330 by implementing Phase 7a: File Lock Manager, the foundational service for parallel agent execution.
The
FileLockManagerprovides a centralized, in-process coordination layer for file access across multiple concurrent tasks/agents. It implements readers-writer lock semantics:releaseAllForTask()wired intoTask.dispose()Key design decisions:
proper-lockfilemechanism insafeWriteJson(which handles inter-process locking) -- this manager coordinates between in-process agents/tasksRooProtectedController(access control) -- locks coordinate "can this task access this file right now" vs "can this mode access this file at all"Files changed:
src/services/file-lock/types.ts- Lock type definitionssrc/services/file-lock/FileLockManager.ts- Core lock manager implementationsrc/services/file-lock/index.ts- Singleton exportsrc/services/file-lock/__tests__/FileLockManager.spec.ts- 24 comprehensive testssrc/core/task/Task.ts- WiredreleaseAllForTaskintodispose()This is Phase 7a only (foundational service). Phase 7b (Write-Capable Background Tasks) will integrate this with tool execution. Feedback and guidance are welcome.
Test Procedure
cd src && npx vitest run services/file-lock/__tests__/FileLockManager.spec.tsPre-Submission Checklist
Documentation Updates
Additional Notes
This PR also includes design recommendations for Phase 7b and 7c posted in the issue comments, addressing the UX questions about write-capable background tasks and history visibility.
Interactively review PR in Roo Code Cloud