@ryan_nookpi/pi-extension-todo-write-overlay 0.2.4 → 0.2.5

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.
Files changed (2) hide show
  1. package/index.ts +6 -1
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -322,6 +322,10 @@ function incrementTodoTurn(ctx: Pick<ExtensionContext, "cwd" | "sessionManager">
322
322
  todoTurnStore.set(key, getTodoTurn(key) + 1);
323
323
  }
324
324
 
325
+ export function shouldIncrementTodoTurn(message: { role: string; stopReason?: string }): boolean {
326
+ return message.role === "assistant" && message.stopReason !== "toolUse";
327
+ }
328
+
325
329
  function setTodoOverlayAgentRunning(ctx: Pick<ExtensionContext, "cwd" | "sessionManager">, running: boolean): void {
326
330
  const key = getTodoStateKey(ctx);
327
331
  todoOverlayAgentRunningStore.set(key, running);
@@ -686,7 +690,8 @@ export default function todoWriteOverlayExtension(pi: ExtensionAPI): void {
686
690
  );
687
691
  });
688
692
 
689
- pi.on("message_end", async (_event, ctx) => {
693
+ pi.on("message_end", async (event, ctx) => {
694
+ if (!shouldIncrementTodoTurn(event.message)) return;
690
695
  incrementTodoTurn(ctx);
691
696
  await syncTodoOverlay(ctx, pi);
692
697
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryan_nookpi/pi-extension-todo-write-overlay",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Top-right overlay todo_write tool extension for pi.",
5
5
  "license": "MIT",
6
6
  "repository": {