@pi-unipi/subagents 2.16.0 → 2.17.0

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/package.json +2 -2
  2. package/src/widget.ts +11 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/subagents",
3
- "version": "2.16.0",
3
+ "version": "2.17.0",
4
4
  "description": "Subagents for UniPi — parallel execution, file locking, workflow integration",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -9,7 +9,7 @@
9
9
  "test": "npx tsx --test src/__tests__/*.test.ts"
10
10
  },
11
11
  "dependencies": {
12
- "@pi-unipi/core": "2.16.0",
12
+ "@pi-unipi/core": "2.17.0",
13
13
  "@earendil-works/pi-agent-core": "^0.84.0",
14
14
  "acorn": "8.18.0"
15
15
  },
package/src/widget.ts CHANGED
@@ -130,10 +130,20 @@ export class AgentWidget {
130
130
  if (this.timer) return;
131
131
  this.timer = setInterval(() => {
132
132
  this.spinnerFrame = (this.spinnerFrame + 1) % SPINNER.length;
133
- if (this.lastContentKey) this.triggerRender();
133
+ if (!this.lastContentKey) return;
134
+ // triggerRender() deliberately skips requestRender when only the
135
+ // spinner changed (content key excludes it), which froze the spinner
136
+ // between real updates. Content diffing still happens there; here we
137
+ // just keep the animation alive while anything is running.
138
+ this.triggerRender();
139
+ if (this.hasRunningAgents()) this.tui?.requestRender?.();
134
140
  }, 80);
135
141
  }
136
142
 
143
+ private hasRunningAgents(): boolean {
144
+ return this.manager.listAgents().some((a) => a.status === "running" || a.status === "queued");
145
+ }
146
+
137
147
  /** Record an agent as finished (call when agent completes). */
138
148
  markFinished(agentId: string) {
139
149
  if (!this.finishedTurnAge.has(agentId)) {