@botcord/daemon 0.2.31 → 0.2.32
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.
|
@@ -341,7 +341,12 @@ export class AcpRuntimeAdapter {
|
|
|
341
341
|
}));
|
|
342
342
|
const stopReason = promptResult?.stopReason ?? "end_turn";
|
|
343
343
|
if (stopReason === "refusal" || stopReason === "error") {
|
|
344
|
-
|
|
344
|
+
const tail = stderrTail.slice(-STDERR_ERROR_SNIPPET).trim();
|
|
345
|
+
state.errorText =
|
|
346
|
+
state.errorText ??
|
|
347
|
+
(tail
|
|
348
|
+
? `prompt stopped: ${stopReason}; stderr: ${tail}`
|
|
349
|
+
: `prompt stopped: ${stopReason}`);
|
|
345
350
|
}
|
|
346
351
|
// Tell the dispatcher the runtime has finished its reasoning loop —
|
|
347
352
|
// important for turns that ended without an `agent_message_chunk`
|
|
@@ -364,9 +369,10 @@ export class AcpRuntimeAdapter {
|
|
|
364
369
|
}
|
|
365
370
|
}
|
|
366
371
|
catch (err) {
|
|
372
|
+
const baseMsg = err instanceof Error ? err.message : String(err);
|
|
373
|
+
const tail = stderrTail.slice(-STDERR_ERROR_SNIPPET).trim();
|
|
367
374
|
state.errorText =
|
|
368
|
-
state.errorText ??
|
|
369
|
-
(err instanceof Error ? err.message : String(err));
|
|
375
|
+
state.errorText ?? (tail ? `${baseMsg}; stderr: ${tail}` : baseMsg);
|
|
370
376
|
try {
|
|
371
377
|
child.stdin.end();
|
|
372
378
|
}
|
package/package.json
CHANGED
|
@@ -478,7 +478,12 @@ export abstract class AcpRuntimeAdapter implements RuntimeAdapter {
|
|
|
478
478
|
|
|
479
479
|
const stopReason = promptResult?.stopReason ?? "end_turn";
|
|
480
480
|
if (stopReason === "refusal" || stopReason === "error") {
|
|
481
|
-
|
|
481
|
+
const tail = stderrTail.slice(-STDERR_ERROR_SNIPPET).trim();
|
|
482
|
+
state.errorText =
|
|
483
|
+
state.errorText ??
|
|
484
|
+
(tail
|
|
485
|
+
? `prompt stopped: ${stopReason}; stderr: ${tail}`
|
|
486
|
+
: `prompt stopped: ${stopReason}`);
|
|
482
487
|
}
|
|
483
488
|
// Tell the dispatcher the runtime has finished its reasoning loop —
|
|
484
489
|
// important for turns that ended without an `agent_message_chunk`
|
|
@@ -499,9 +504,10 @@ export abstract class AcpRuntimeAdapter implements RuntimeAdapter {
|
|
|
499
504
|
/* best-effort */
|
|
500
505
|
}
|
|
501
506
|
} catch (err) {
|
|
507
|
+
const baseMsg = err instanceof Error ? err.message : String(err);
|
|
508
|
+
const tail = stderrTail.slice(-STDERR_ERROR_SNIPPET).trim();
|
|
502
509
|
state.errorText =
|
|
503
|
-
state.errorText ??
|
|
504
|
-
(err instanceof Error ? err.message : String(err));
|
|
510
|
+
state.errorText ?? (tail ? `${baseMsg}; stderr: ${tail}` : baseMsg);
|
|
505
511
|
try {
|
|
506
512
|
child.stdin.end();
|
|
507
513
|
} catch {
|