osborn 0.9.263 → 0.9.264
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/claude-llm.d.ts +11 -0
- package/dist/claude-llm.js +28 -0
- package/package.json +1 -1
package/dist/claude-llm.d.ts
CHANGED
|
@@ -290,6 +290,17 @@ export declare class ClaudeLLM extends llm.LLM {
|
|
|
290
290
|
noteTaskDispatch(toolUseId: string | undefined, subagentType: string | undefined): void;
|
|
291
291
|
/** SubagentStart claim: pair this agent_id with the oldest unclaimed dispatch of its type. */
|
|
292
292
|
claimTaskDispatch(agentId: string | undefined, subagentType: string | undefined): void;
|
|
293
|
+
/**
|
|
294
|
+
* Bounded-leak fix (0.9.264): drop a finished agent's pairing entries at
|
|
295
|
+
* SubagentStop. BOTH maps must go together — #resolveTaskId deliberately
|
|
296
|
+
* returns null when a pairing exists for an ended task (so a stale stop-click
|
|
297
|
+
* can never retarget a DIFFERENT live agent of the same type); with both
|
|
298
|
+
* entries deleted the resolve is null just the same, so behavior is unchanged
|
|
299
|
+
* while the maps stay bounded (they previously grew one entry per sub-agent
|
|
300
|
+
* for the life of the session, 200+ in heavy use). #dispatchedFor is NOT
|
|
301
|
+
* cleared here: it IS the double-fire dedup for the SubagentStop hook itself.
|
|
302
|
+
*/
|
|
303
|
+
releaseAgentTracking(agentId: string | undefined): void;
|
|
293
304
|
/** Background consumer feed: track SDK task lifecycle messages. */
|
|
294
305
|
trackTaskMessage(msg: any): void;
|
|
295
306
|
/** Live background tasks (for truthful status/UX). */
|
package/dist/claude-llm.js
CHANGED
|
@@ -1411,6 +1411,14 @@ export class ClaudeLLM extends llm.LLM {
|
|
|
1411
1411
|
captureCheckpoint(checkpointId) {
|
|
1412
1412
|
this.#checkpoints.push(checkpointId);
|
|
1413
1413
|
this.#latestCheckpoint = checkpointId;
|
|
1414
|
+
// Bounded-leak fix (0.9.264): a checkpoint lands on EVERY user-type SDK
|
|
1415
|
+
// message (tool results included) — thousands over a long session, never
|
|
1416
|
+
// pruned. Rewind only ever consumes the FIRST (getFirstCheckpoint →
|
|
1417
|
+
// session start) and the LATEST (#latestCheckpoint, kept separately), so
|
|
1418
|
+
// retain [0] + the most recent 500 and drop the middle.
|
|
1419
|
+
if (this.#checkpoints.length > 600) {
|
|
1420
|
+
this.#checkpoints.splice(1, this.#checkpoints.length - 501);
|
|
1421
|
+
}
|
|
1414
1422
|
console.log(`📍 Checkpoint captured: ${checkpointId.substring(0, 8)}...`);
|
|
1415
1423
|
this.#eventEmitter.emit('checkpoint_captured', { checkpointId });
|
|
1416
1424
|
}
|
|
@@ -1670,6 +1678,22 @@ export class ClaudeLLM extends llm.LLM {
|
|
|
1670
1678
|
this.#toolUseByAgentId.set(agentId, toolUse);
|
|
1671
1679
|
}
|
|
1672
1680
|
}
|
|
1681
|
+
/**
|
|
1682
|
+
* Bounded-leak fix (0.9.264): drop a finished agent's pairing entries at
|
|
1683
|
+
* SubagentStop. BOTH maps must go together — #resolveTaskId deliberately
|
|
1684
|
+
* returns null when a pairing exists for an ended task (so a stale stop-click
|
|
1685
|
+
* can never retarget a DIFFERENT live agent of the same type); with both
|
|
1686
|
+
* entries deleted the resolve is null just the same, so behavior is unchanged
|
|
1687
|
+
* while the maps stay bounded (they previously grew one entry per sub-agent
|
|
1688
|
+
* for the life of the session, 200+ in heavy use). #dispatchedFor is NOT
|
|
1689
|
+
* cleared here: it IS the double-fire dedup for the SubagentStop hook itself.
|
|
1690
|
+
*/
|
|
1691
|
+
releaseAgentTracking(agentId) {
|
|
1692
|
+
if (!agentId)
|
|
1693
|
+
return;
|
|
1694
|
+
this.#toolUseByAgentId.delete(agentId);
|
|
1695
|
+
this.#typeByAgentId.delete(agentId);
|
|
1696
|
+
}
|
|
1673
1697
|
/** Background consumer feed: track SDK task lifecycle messages. */
|
|
1674
1698
|
trackTaskMessage(msg) {
|
|
1675
1699
|
if (msg?.type !== 'system')
|
|
@@ -2771,6 +2795,10 @@ class ClaudeLLMStream extends llm.LLMStream {
|
|
|
2771
2795
|
console.warn('Pattern#1 chain push failed:', e);
|
|
2772
2796
|
}
|
|
2773
2797
|
}
|
|
2798
|
+
// Bounded-leak fix (0.9.264): the agent is done — release its
|
|
2799
|
+
// pairing entries (after the chain logic above has run).
|
|
2800
|
+
if (input?.agent_id)
|
|
2801
|
+
this.#llmRef.releaseAgentTracking(input.agent_id);
|
|
2774
2802
|
return {};
|
|
2775
2803
|
}]
|
|
2776
2804
|
}],
|