clawcompany 0.50.0 → 0.51.0
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/dist/index.js +43 -35
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2149,7 +2149,7 @@ import { join } from "path";
|
|
|
2149
2149
|
import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
|
|
2150
2150
|
function banner() {
|
|
2151
2151
|
console.log("");
|
|
2152
|
-
console.log(" \u{1F99E} ClawCompany v0.
|
|
2152
|
+
console.log(" \u{1F99E} ClawCompany v0.51.0");
|
|
2153
2153
|
console.log(" Build for OPC. Every human being is a chairman.");
|
|
2154
2154
|
console.log("");
|
|
2155
2155
|
}
|
|
@@ -3686,6 +3686,7 @@ Respond ONLY with JSON:
|
|
|
3686
3686
|
}
|
|
3687
3687
|
console.log(` \u{1F4E6} Batch ${batch}: ${ready.map((ws) => ws.id).join(", ")}
|
|
3688
3688
|
`);
|
|
3689
|
+
const MAX_RETRIES = 2;
|
|
3689
3690
|
const batchResults = await Promise.all(ready.map(async (ws) => {
|
|
3690
3691
|
const depOutputs = {};
|
|
3691
3692
|
for (const depId of ws.dependencies ?? []) {
|
|
@@ -3698,44 +3699,51 @@ Respond ONLY with JSON:
|
|
|
3698
3699
|
console.log(` \u26A1 ${ws.id}: ${ws.title}`);
|
|
3699
3700
|
console.log(` \u2192 ${roleName} (${modelName})`);
|
|
3700
3701
|
const startTime = Date.now();
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3702
|
+
for (let attempt = 1; attempt <= MAX_RETRIES + 1; attempt++) {
|
|
3703
|
+
try {
|
|
3704
|
+
const output = await this.executeWorkStream(ws, depOutputs);
|
|
3705
|
+
const elapsed = ((Date.now() - startTime) / 1e3).toFixed(1);
|
|
3706
|
+
totalCost += output.cost;
|
|
3707
|
+
console.log(` \u2705 Done (${elapsed}s, $${output.cost.toFixed(4)})${attempt > 1 ? ` [retry ${attempt - 1}]` : ""}
|
|
3706
3708
|
`);
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3709
|
+
return {
|
|
3710
|
+
id: ws.id,
|
|
3711
|
+
result: {
|
|
3712
|
+
workStreamId: ws.id,
|
|
3713
|
+
title: ws.title,
|
|
3714
|
+
assignedTo: ws.assignTo,
|
|
3715
|
+
output: output.content,
|
|
3716
|
+
cost: output.cost,
|
|
3717
|
+
tokensIn: output.tokensIn,
|
|
3718
|
+
tokensOut: output.tokensOut,
|
|
3719
|
+
model: output.model,
|
|
3720
|
+
status: "completed"
|
|
3721
|
+
}
|
|
3722
|
+
};
|
|
3723
|
+
} catch (err) {
|
|
3724
|
+
if (attempt <= MAX_RETRIES) {
|
|
3725
|
+
console.log(` \u{1F504} ${ws.id}: Retry ${attempt}/${MAX_RETRIES} \u2014 ${err.message}`);
|
|
3726
|
+
continue;
|
|
3719
3727
|
}
|
|
3720
|
-
|
|
3721
|
-
} catch (err) {
|
|
3722
|
-
console.log(` \u274C Failed: ${err.message}
|
|
3728
|
+
console.log(` \u274C Failed after ${MAX_RETRIES} retries: ${err.message}
|
|
3723
3729
|
`);
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3730
|
+
return {
|
|
3731
|
+
id: ws.id,
|
|
3732
|
+
result: {
|
|
3733
|
+
workStreamId: ws.id,
|
|
3734
|
+
title: ws.title,
|
|
3735
|
+
assignedTo: ws.assignTo,
|
|
3736
|
+
output: `Error: ${err.message}`,
|
|
3737
|
+
cost: 0,
|
|
3738
|
+
tokensIn: 0,
|
|
3739
|
+
tokensOut: 0,
|
|
3740
|
+
model: "none",
|
|
3741
|
+
status: "failed"
|
|
3742
|
+
}
|
|
3743
|
+
};
|
|
3744
|
+
}
|
|
3738
3745
|
}
|
|
3746
|
+
throw new Error(`Unexpected: ${ws.id} exited retry loop`);
|
|
3739
3747
|
}));
|
|
3740
3748
|
for (const { id, result } of batchResults) {
|
|
3741
3749
|
results.set(id, result);
|
package/package.json
CHANGED