Commit db6af72
Eric Wheeler
feat: task history scan/rebuild with advanced UI tools
Implement a comprehensive task history management system with UI tools for scanning, diagnosing, and repairing history issues:
- Add new HistoryScanResults and HistoryRebuildOptions interfaces
- Refactor reindexHistoryItems into modular components:
- scanTaskHistory: Identifies valid, orphaned, and missing tasks
- rebuildIndexes: Rebuilds indexes with configurable options
- reconstructTask: Recovers orphaned tasks from UI messages
- Create new HistoryIndexTools UI component with:
- Task history scanning capabilities
- Configurable rebuild options (merge/replace modes)
- Task preview and inspection tools
- Real-time operation logging
- Improve error handling and provide detailed logging
- Update message handlers and type definitions
- Add comprehensive translations for the new UI
This change helps users diagnose and fix task history inconsistencies between global state and filesystem, preventing "lost" tasks and improving history reliability.
Signed-off-by: Eric Wheeler <[email protected]>
fix: prevent ReDoS vulnerability in log message regex
Replace non-greedy wildcard pattern (.*?) with a more specific character class [^\]]*
to avoid potential catastrophic backtracking on malicious input.
This addresses a security vulnerability where the regex could run slow on
strings starting with '[]' and containing many repetitions of '\t'.
Signed-off-by: Eric Wheeler <[email protected]>
fix: replace regex with string indexes in logMessage
Replace regex pattern with string index operations in logMessage function to
avoid potential ReDoS (Regular Expression Denial of Service) vulnerabilities.
The change uses indexOf and substring instead of regex matching, which is
more efficient and safer for processing log messages with tags.
Signed-off-by: Eric Wheeler <[email protected]>
refactor: implement mutual exclusion for history operations
Created a mutex pattern to ensure history operations are mutually exclusive.
This prevents concurrent execution of reindexHistoryItems and search operations,
maintaining data consistency during indexing.
Extracted common mutex logic into a reusable _withMutex helper function.
Signed-off-by: Eric Wheeler <[email protected]>
feat: add bidirectional sync with legacy globalState
Adds capability to synchronize tasks between the new file-based history system and legacy VSCode globalState storage:
- Renamed mergeGlobal to mergeFromGlobal for clarity
- Added new mergeToGlobal option to update globalState with file index data
- Added tracking of tasks that exist only in file indexes via tasksOnlyInTaskHistoryIndexes
- Added developer UI controls in advanced section for managing globalState sync
- Updated tests and documentation to reflect new bidirectional capabilities
This feature enables backward compatibility testing with older versions of Roo Code by ensuring tasks created in the new storage format are also available in the legacy format.
Signed-off-by: Eric Wheeler <[email protected]>
refactor: make rebuildIndexes private by renaming to _rebuildIndexes
This change makes the rebuildIndexes function private by adding an underscore prefix
to its name, following the project's convention for private functions. All references
to this function have been updated accordingly in both the implementation and test files.
Signed-off-by: Eric Wheeler <[email protected]>1 parent f86d351 commit db6af72
File tree
12 files changed
+1700
-5
lines changed- packages/types/src
- src
- core
- task-persistence
- webview
- i18n/locales/en
- webview-ui/src
- components/settings
- i18n/locales/en
12 files changed
+1700
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
0 commit comments