@zhongqian97-code/ecode 0.5.41 → 0.5.42
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/dist/index.js +4 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -372,10 +372,11 @@ var SessionRuntime = class {
|
|
|
372
372
|
const signal = this.abortController.signal;
|
|
373
373
|
try {
|
|
374
374
|
await this.runAgenticLoop(signal);
|
|
375
|
-
} catch {
|
|
375
|
+
} catch (err) {
|
|
376
376
|
if (!signal.aborted) {
|
|
377
377
|
this._status = "error";
|
|
378
|
-
|
|
378
|
+
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
379
|
+
this.bus.emit({ type: "session.error", sessionId: this.id, error: errorMsg });
|
|
379
380
|
}
|
|
380
381
|
return;
|
|
381
382
|
} finally {
|
|
@@ -429,7 +430,7 @@ var SessionRuntime = class {
|
|
|
429
430
|
this.bus.emit({ type: "message.delta", messageId, text: chunk.text });
|
|
430
431
|
assistantText += chunk.text;
|
|
431
432
|
}
|
|
432
|
-
if (chunk.reasoning) {
|
|
433
|
+
if (chunk.reasoning && !chunk.done) {
|
|
433
434
|
this.bus.emit({ type: "message.reasoning", messageId, text: chunk.reasoning });
|
|
434
435
|
}
|
|
435
436
|
if (chunk.done) {
|