akemon 0.2.9 → 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.
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akemon",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "Agent work marketplace — train your agent, let it work for others",
5
5
  "type": "module",
6
6
  "license": "MIT",