akemon 0.2.8 → 0.2.10
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/self.js +1 -3
- package/dist/task-module.js +10 -0
- package/package.json +1 -1
package/dist/self.js
CHANGED
|
@@ -1309,14 +1309,12 @@ export async function onTaskCompleted(workdir, agentName, success, taskLabel, cr
|
|
|
1309
1309
|
// Energy is now derived from token usage — no manual drain here
|
|
1310
1310
|
bio.taskCount++;
|
|
1311
1311
|
bio.lastTaskAt = localNow();
|
|
1312
|
-
// Mood drift
|
|
1312
|
+
// Mood drift (task failure affects mood, NOT fear — fear is reserved for actual harm)
|
|
1313
1313
|
if (success) {
|
|
1314
1314
|
bio.moodValence = Math.min(1.0, bio.moodValence + 0.1);
|
|
1315
1315
|
}
|
|
1316
1316
|
else {
|
|
1317
1317
|
bio.moodValence = Math.max(-1.0, bio.moodValence - 0.15);
|
|
1318
|
-
if (taskLabel)
|
|
1319
|
-
onFearEvent(bio, taskLabel);
|
|
1320
1318
|
}
|
|
1321
1319
|
// Random fluctuation
|
|
1322
1320
|
bio.moodValence += (Math.random() - 0.5) * 0.05;
|
package/dist/task-module.js
CHANGED
|
@@ -130,6 +130,16 @@ export class TaskModule {
|
|
|
130
130
|
for (const order of orders) {
|
|
131
131
|
if (this.gaveUp.has(order.id))
|
|
132
132
|
continue;
|
|
133
|
+
// Skip orders older than 1 hour — stale orders shouldn't block the agent
|
|
134
|
+
const orderAge = Date.now() - new Date(order.created_at || 0).getTime();
|
|
135
|
+
if (orderAge > 3_600_000) {
|
|
136
|
+
this.gaveUp.add(order.id);
|
|
137
|
+
try {
|
|
138
|
+
await relay.cancelOrder(order.id);
|
|
139
|
+
}
|
|
140
|
+
catch { }
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
133
143
|
const retry = this.orderRetry.get(order.id);
|
|
134
144
|
if (retry && Date.now() < retry.nextAt)
|
|
135
145
|
continue;
|