@piotr-oles/pi-subagents 1.0.0 → 1.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@piotr-oles/pi-subagents",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Pi Agent extension: spawn specialized subagents with isolated sessions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -149,6 +149,10 @@ export class RunningSubagent {
149
149
  ): Promise<void> {
150
150
  const session = this.session;
151
151
  const unsubscribe = session.subscribe(async (event: AgentSessionEvent) => {
152
+ if (this.state.aborted) {
153
+ return;
154
+ }
155
+
152
156
  switch (event.type) {
153
157
  case "turn_end":
154
158
  this.state.turn++;
@@ -78,17 +78,14 @@ export class SubagentStore {
78
78
  entry.instance = entry.instance.run({
79
79
  onUpdate: (running: RunningSubagent) => {
80
80
  if (entry.instance.status !== "running") {
81
- throw new Error(`Cannot update non-running (${entry.instance.status}) subagent.`);
81
+ return;
82
82
  }
83
83
  params.onUpdate(running);
84
84
  entry.instance = running;
85
85
  },
86
86
  onDone: (done: DoneSubagent) => {
87
- if (entry.instance.status === "done") {
88
- return; // noop
89
- }
90
87
  if (entry.instance.status !== "running") {
91
- throw new Error(`Cannot mark done non-running (${entry.instance.status}) subagent.`);
88
+ return;
92
89
  }
93
90
  this.running.delete(entry.instance.id);
94
91
  params.onDone(done);
@@ -268,7 +268,7 @@ class SubagentSummaryTextComponent implements Component {
268
268
  const theme = this.theme;
269
269
  const parts: string[] = [];
270
270
  if (done.result.status === "error") {
271
- parts.push(theme.fg("error", done.result.error));
271
+ parts.push(theme.fg("error", getFirstLine(done.result.error)));
272
272
  }
273
273
  if (done.result.status === "aborted") {
274
274
  parts.push(theme.fg("dim", "cancelled"));