@rowan-agent/agent 0.9.23 → 0.9.25

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.d.ts CHANGED
@@ -2413,6 +2413,13 @@ declare class InMemoryStore implements DurableStore {
2413
2413
  * one history snapshot per Agent instead of one per Attempt.
2414
2414
  */
2415
2415
  private dropClaimReceipt;
2416
+ /**
2417
+ * A new owner fences the Execution Attempts of the previous one, so no Claim
2418
+ * receipt from before the takeover can be replayed. Sweeping them reclaims
2419
+ * the history snapshots a store accumulated while no Attempt ended under
2420
+ * this Runtime.
2421
+ */
2422
+ dropSettledClaimReceipts(): void;
2416
2423
  private requireAgent;
2417
2424
  private requireRun;
2418
2425
  private requireToolCall;
package/dist/index.js CHANGED
@@ -6989,6 +6989,7 @@ var InMemoryStore = class _InMemoryStore {
6989
6989
  return new MemoryOwnedStore(this, clone(this.owner));
6990
6990
  }
6991
6991
  if (this.owner) this.interruptOwner(this.owner.epoch);
6992
+ this.dropSettledClaimReceipts();
6992
6993
  this.ownerEpoch += 1;
6993
6994
  this.owner = {
6994
6995
  ownerId: input.ownerId,
@@ -7911,6 +7912,23 @@ var InMemoryStore = class _InMemoryStore {
7911
7912
  dropClaimReceipt(execution) {
7912
7913
  if (execution) this.operationReceipts.delete(`claim:${execution.executionId}`);
7913
7914
  }
7915
+ /**
7916
+ * A new owner fences the Execution Attempts of the previous one, so no Claim
7917
+ * receipt from before the takeover can be replayed. Sweeping them reclaims
7918
+ * the history snapshots a store accumulated while no Attempt ended under
7919
+ * this Runtime.
7920
+ */
7921
+ dropSettledClaimReceipts() {
7922
+ const liveExecutions = /* @__PURE__ */ new Set();
7923
+ for (const run of this.runs.values()) {
7924
+ if (run.state === "running" && run.execution) liveExecutions.add(String(run.execution.executionId));
7925
+ }
7926
+ for (const key of [...this.operationReceipts.keys()]) {
7927
+ if (key.startsWith("claim:") && !liveExecutions.has(key.slice("claim:".length))) {
7928
+ this.operationReceipts.delete(key);
7929
+ }
7930
+ }
7931
+ }
7914
7932
  requireAgent(agentId) {
7915
7933
  const agent = this.agents.get(agentId);
7916
7934
  if (!agent) throw new RuntimeError("agent_not_found", { agentId });
@@ -8455,6 +8473,7 @@ var SqliteStore = class {
8455
8473
  released_epoch: row.released_epoch
8456
8474
  };
8457
8475
  this.writeOwner(next);
8476
+ memory.dropSettledClaimReceipts();
8458
8477
  this.persistState(memory.exportState());
8459
8478
  return {
8460
8479
  ownerId: input.ownerId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rowan-agent/agent",
3
- "version": "0.9.23",
3
+ "version": "0.9.25",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",