@defai.digital/automatosx 6.2.8 → 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 +36 -0
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,42 @@
|
|
|
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
|
+
|
|
5
41
|
## [6.2.8] - 2025-10-31
|
|
6
42
|
|
|
7
43
|
### 🔧 Fixes
|
package/dist/index.js
CHANGED
|
@@ -19615,6 +19615,7 @@ var ParallelAgentExecutor = class {
|
|
|
19615
19615
|
const minStartTime = Math.min(...timeline.map((t) => t.startTime));
|
|
19616
19616
|
const maxEndTime = Math.max(...timeline.map((t) => t.endTime));
|
|
19617
19617
|
const totalDuration = maxEndTime - minStartTime;
|
|
19618
|
+
const safeTotalDuration = Math.max(1, totalDuration);
|
|
19618
19619
|
for (let level = 0; level <= maxLevel; level++) {
|
|
19619
19620
|
const entriesAtLevel = timeline.filter((t) => t.level === level);
|
|
19620
19621
|
if (entriesAtLevel.length === 0) {
|
|
@@ -19623,7 +19624,7 @@ var ParallelAgentExecutor = class {
|
|
|
19623
19624
|
output += chalk29.gray(`Level ${level}:
|
|
19624
19625
|
`);
|
|
19625
19626
|
for (const entry of entriesAtLevel) {
|
|
19626
|
-
const barLength = Math.max(1, Math.floor(entry.duration /
|
|
19627
|
+
const barLength = Math.max(1, Math.floor(entry.duration / safeTotalDuration * 40));
|
|
19627
19628
|
const bar = "\u2588".repeat(barLength);
|
|
19628
19629
|
let statusColor = chalk29.green;
|
|
19629
19630
|
let statusIcon = "\u2713";
|