@shanepadgett/tau-agent 0.31.0 → 0.31.1

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.
@@ -149,11 +149,27 @@ function addReferenceCatalog(
149
149
  timestamp: 0,
150
150
  },
151
151
  ];
152
+ let deferredAssistantUnits: MemoryUnit[] = [];
153
+ let pendingToolCallIds = new Set<string>();
152
154
  for (let index = 0; index < messages.length; index += 1) {
153
155
  const message = messages[index];
154
156
  if (!message) continue;
155
157
  projected.push(message);
156
158
  const unique = new Map((unitsByMessage[index] ?? []).map((unit) => [unit.ref, unit]));
159
+ if (message.role === "assistant") {
160
+ pendingToolCallIds = new Set(
161
+ message.content.filter((block) => block.type === "toolCall").map((block) => block.id),
162
+ );
163
+ if (pendingToolCallIds.size > 0) {
164
+ deferredAssistantUnits = [...unique.values()];
165
+ continue;
166
+ }
167
+ }
168
+ if (message.role === "toolResult" && pendingToolCallIds.delete(message.toolCallId)) {
169
+ if (pendingToolCallIds.size > 0) continue;
170
+ for (const unit of deferredAssistantUnits) unique.set(unit.ref, unit);
171
+ deferredAssistantUnits = [];
172
+ }
157
173
  if (unique.size === 0) continue;
158
174
  projected.push({
159
175
  role: "custom",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shanepadgett/tau-agent",
3
- "version": "0.31.0",
3
+ "version": "0.31.1",
4
4
  "description": "Tau is a custom agentic harness built with pi extensions",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -35,7 +35,7 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@ast-grep/wasm": "0.45.0",
38
- "@shanepadgett/tau-tui": "0.31.0",
38
+ "@shanepadgett/tau-tui": "0.31.1",
39
39
  "@vscode/tree-sitter-wasm": "0.3.1",
40
40
  "image-size": "2.0.2",
41
41
  "smol-toml": "1.7.0",