@defai.digital/automatosx 6.2.7 → 6.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +75 -0
- package/dist/index.js +6 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,81 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [6.2.9] - 2025-10-31
|
|
6
|
+
|
|
7
|
+
### 🔧 Fixes
|
|
8
|
+
|
|
9
|
+
**Timeline Visualization Division by Zero (Bug #36)**
|
|
10
|
+
|
|
11
|
+
Through systematic heavy-thinking analysis of division operations in agent execution code:
|
|
12
|
+
|
|
13
|
+
- **Bug #36 (MEDIUM)**: Division by zero in timeline visualization when all agents complete in same millisecond
|
|
14
|
+
- **File affected**: `src/agents/parallel-agent-executor.ts:616`
|
|
15
|
+
- **Problem**: `totalDuration = maxEndTime - minStartTime` can be **0** if all agents complete instantly (same ms)
|
|
16
|
+
- **Impact**: RangeError crash - `entry.duration / 0` = `Infinity`, then `'█'.repeat(Infinity)` throws RangeError
|
|
17
|
+
- **Root Cause**: No guard against zero duration when calculating progress bar lengths
|
|
18
|
+
- **Fix**: Added `safeTotalDuration = Math.max(1, totalDuration)` to ensure minimum 1ms duration
|
|
19
|
+
- **Scenario**: Fast-executing agents or test scenarios where all agents complete in < 1ms
|
|
20
|
+
|
|
21
|
+
### 🔍 Analysis Methodology
|
|
22
|
+
|
|
23
|
+
- **Heavy-thinking division analysis**: Systematically checked all division operations in `src/agents/`
|
|
24
|
+
- **Math operations verified**: `Math.max()` does NOT protect against `Infinity` (only against negative/smaller values)
|
|
25
|
+
- **Error chain traced**: `x/0` → `Infinity` → `Math.floor(Infinity)` → `Infinity` → `repeat(Infinity)` → RangeError
|
|
26
|
+
- **Fixed vulnerable operation**: parallel-agent-executor.ts timeline bar length calculation
|
|
27
|
+
|
|
28
|
+
### 📊 Impact
|
|
29
|
+
|
|
30
|
+
- **Users affected**: Users running parallel agents that complete very quickly (< 1ms)
|
|
31
|
+
- **Severity**: Medium (rare but causes complete crash when triggered)
|
|
32
|
+
- **Breaking changes**: None
|
|
33
|
+
- **Migration**: None required - automatic fix
|
|
34
|
+
|
|
35
|
+
### ✅ Testing
|
|
36
|
+
|
|
37
|
+
- All 2,281 unit tests passing
|
|
38
|
+
- TypeScript compilation successful
|
|
39
|
+
- Build successful
|
|
40
|
+
|
|
41
|
+
## [6.2.8] - 2025-10-31
|
|
42
|
+
|
|
43
|
+
### 🔧 Fixes
|
|
44
|
+
|
|
45
|
+
**Provider Error Handler Timer Race Condition (Bug #35)**
|
|
46
|
+
|
|
47
|
+
Through systematic heavy-thinking analysis of provider timer cleanup patterns:
|
|
48
|
+
|
|
49
|
+
- **Bug #35 (MEDIUM)**: Missing cleanup() call in child process error handlers across all CLI providers
|
|
50
|
+
- **Files affected**:
|
|
51
|
+
- `src/providers/openai-provider.ts` (2 locations: lines 360, 760)
|
|
52
|
+
- `src/providers/claude-provider.ts` (line 445)
|
|
53
|
+
- `src/providers/gemini-provider.ts` (line 399)
|
|
54
|
+
- **Problem**: Error handlers call `cleanupAbortListener()` but NOT `cleanup()`, leaving timers running
|
|
55
|
+
- **Impact**: Race condition - if child.on('error') fires, mainTimeout continues and can create orphaned nestedKillTimeout
|
|
56
|
+
- **Root Cause**: Inconsistent cleanup pattern - close/timeout/abort handlers all call cleanup(), but error handler doesn't
|
|
57
|
+
- **Fix**: Added `cleanup()` call before `cleanupAbortListener()` in all error handlers (matching close handler pattern)
|
|
58
|
+
- **Scenario**: Between error event and close event, timers fire and create nested timers that aren't cleaned until close
|
|
59
|
+
|
|
60
|
+
### 🔍 Analysis Methodology
|
|
61
|
+
|
|
62
|
+
- **Heavy-thinking provider analysis**: Systematically checked all child.on('error') handlers in CLI providers
|
|
63
|
+
- **Pattern comparison**: Verified cleanup() is called in close, timeout, and abort handlers
|
|
64
|
+
- **Verified vulnerable operations**: All 3 CLI providers (OpenAI, Claude, Gemini) had same bug
|
|
65
|
+
- **Fixed**: 4 total error handler locations across 3 provider files
|
|
66
|
+
|
|
67
|
+
### 📊 Impact
|
|
68
|
+
|
|
69
|
+
- **Users affected**: Users experiencing provider CLI process errors during execution
|
|
70
|
+
- **Severity**: Medium (timers eventually cleaned in close handler, but race condition window exists)
|
|
71
|
+
- **Breaking changes**: None
|
|
72
|
+
- **Migration**: None required - automatic cleanup improvement
|
|
73
|
+
|
|
74
|
+
### ✅ Testing
|
|
75
|
+
|
|
76
|
+
- All 2,281 unit tests passing
|
|
77
|
+
- TypeScript compilation successful
|
|
78
|
+
- Build successful
|
|
79
|
+
|
|
5
80
|
## [6.2.7] - 2025-10-31
|
|
6
81
|
|
|
7
82
|
### 🔧 Fixes
|
package/dist/index.js
CHANGED
|
@@ -4363,6 +4363,7 @@ Details: ${errorMsg}`
|
|
|
4363
4363
|
}
|
|
4364
4364
|
});
|
|
4365
4365
|
child.on("error", (error) => {
|
|
4366
|
+
cleanup();
|
|
4366
4367
|
cleanupAbortListener();
|
|
4367
4368
|
if (hasTimedOut) {
|
|
4368
4369
|
return;
|
|
@@ -5018,6 +5019,7 @@ This is a placeholder response. Set AUTOMATOSX_MOCK_PROVIDERS=false to use real
|
|
|
5018
5019
|
}
|
|
5019
5020
|
});
|
|
5020
5021
|
child.on("error", (error) => {
|
|
5022
|
+
cleanup();
|
|
5021
5023
|
cleanupAbortListener();
|
|
5022
5024
|
if (!hasTimedOut) {
|
|
5023
5025
|
reject(ProviderError.executionError(this.config.name, error));
|
|
@@ -5510,6 +5512,7 @@ This is a placeholder response. Set AUTOMATOSX_MOCK_PROVIDERS=false to use real
|
|
|
5510
5512
|
}
|
|
5511
5513
|
});
|
|
5512
5514
|
child.on("error", (error) => {
|
|
5515
|
+
cleanup();
|
|
5513
5516
|
cleanupAbortListener();
|
|
5514
5517
|
if (!hasTimedOut) {
|
|
5515
5518
|
reject(new Error(`Failed to spawn OpenAI CLI: ${error.message}`));
|
|
@@ -5779,6 +5782,7 @@ This is a placeholder streaming response.`;
|
|
|
5779
5782
|
}
|
|
5780
5783
|
});
|
|
5781
5784
|
child.on("error", (error) => {
|
|
5785
|
+
cleanup();
|
|
5782
5786
|
cleanupAbortListener();
|
|
5783
5787
|
if (!hasTimedOut) {
|
|
5784
5788
|
reject(new Error(`Failed to spawn OpenAI CLI: ${error.message}`));
|
|
@@ -19611,6 +19615,7 @@ var ParallelAgentExecutor = class {
|
|
|
19611
19615
|
const minStartTime = Math.min(...timeline.map((t) => t.startTime));
|
|
19612
19616
|
const maxEndTime = Math.max(...timeline.map((t) => t.endTime));
|
|
19613
19617
|
const totalDuration = maxEndTime - minStartTime;
|
|
19618
|
+
const safeTotalDuration = Math.max(1, totalDuration);
|
|
19614
19619
|
for (let level = 0; level <= maxLevel; level++) {
|
|
19615
19620
|
const entriesAtLevel = timeline.filter((t) => t.level === level);
|
|
19616
19621
|
if (entriesAtLevel.length === 0) {
|
|
@@ -19619,7 +19624,7 @@ var ParallelAgentExecutor = class {
|
|
|
19619
19624
|
output += chalk29.gray(`Level ${level}:
|
|
19620
19625
|
`);
|
|
19621
19626
|
for (const entry of entriesAtLevel) {
|
|
19622
|
-
const barLength = Math.max(1, Math.floor(entry.duration /
|
|
19627
|
+
const barLength = Math.max(1, Math.floor(entry.duration / safeTotalDuration * 40));
|
|
19623
19628
|
const bar = "\u2588".repeat(barLength);
|
|
19624
19629
|
let statusColor = chalk29.green;
|
|
19625
19630
|
let statusIcon = "\u2713";
|