pi-landstrip 0.18.40 → 0.18.41

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/dist/index.ts +9 -2
  2. package/package.json +2 -2
package/dist/index.ts CHANGED
@@ -4293,6 +4293,7 @@ ${catalog.diagnostics.join(`
4293
4293
  throw new Error("Task cancelled");
4294
4294
  let turns = 0;
4295
4295
  let streamedText = "";
4296
+ let workerError;
4296
4297
  worker.rpc.onEvent((event) => {
4297
4298
  if (event.type === "message_update" && isRecord2(event.assistantMessageEvent)) {
4298
4299
  const messageEvent = event.assistantMessageEvent;
@@ -4301,7 +4302,10 @@ ${catalog.diagnostics.join(`
4301
4302
  update(streamedText);
4302
4303
  }
4303
4304
  }
4304
- if (event.type === "message_end") {
4305
+ if (event.type === "message_end" && isRecord2(event.message)) {
4306
+ if (event.message.role === "assistant") {
4307
+ workerError = event.message.stopReason === "error" ? typeof event.message.errorMessage === "string" ? event.message.errorMessage : "Subagent model request failed" : undefined;
4308
+ }
4305
4309
  const usage = taskUsageFromMessage(event.message);
4306
4310
  if (usage) {
4307
4311
  task.usage = addTaskUsage(task.usage, usage);
@@ -4362,6 +4366,8 @@ ${catalog.diagnostics.join(`
4362
4366
  await worker.rpc.request("follow_up", { message: pendingPrompt });
4363
4367
  }
4364
4368
  const output = await promise;
4369
+ if (workerError)
4370
+ throw new Error(workerError);
4365
4371
  if (signal.aborted)
4366
4372
  throw new Error("Task cancelled");
4367
4373
  task.state = "completed";
@@ -4458,6 +4464,7 @@ ${catalog.diagnostics.join(`
4458
4464
  if (!sessionWritePath)
4459
4465
  throw new Error("Subagent task has no session directory or file");
4460
4466
  const authPath = join6(agentDir, "auth.json");
4467
+ const settingsPath = join6(agentDir, "settings.json");
4461
4468
  const cliEntry = invocation.args[0] ?? invocation.command;
4462
4469
  const cliRoot = dependencyRoot(cliEntry) ?? dirname3(dirname3(cliEntry));
4463
4470
  const extensionRoot = dependencyRoot(packageDir);
@@ -4495,7 +4502,7 @@ ${catalog.diagnostics.join(`
4495
4502
  temp
4496
4503
  ].filter((path) => path !== undefined))
4497
4504
  ],
4498
- writePaths: [sessionWritePath, temp, authPath, `${authPath}.lock`],
4505
+ writePaths: [sessionWritePath, temp, authPath, `${authPath}.lock`, `${settingsPath}.lock`],
4499
4506
  signal
4500
4507
  });
4501
4508
  if (signal.aborted)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-landstrip",
3
- "version": "0.18.40",
3
+ "version": "0.18.41",
4
4
  "description": "Sandboxed Bash and process-backed agents for Pi",
5
5
  "keywords": [
6
6
  "landstrip",
@@ -39,7 +39,7 @@
39
39
  "ci:test": "npm run test"
40
40
  },
41
41
  "dependencies": {
42
- "@landstrip/landstrip-api": "^0.18.40",
42
+ "@landstrip/landstrip-api": "^0.18.41",
43
43
  "jsonc-parser": "^3.3.1",
44
44
  "minimatch": "^10.2.5",
45
45
  "yaml": "^2.9.0"