fix(resume): recover cleanly after Pi exits
This commit is contained in:
@@ -33,7 +33,7 @@ export class SessionBridge {
|
||||
m.message?.role === "assistant" &&
|
||||
m.message?.stopReason === "error"
|
||||
) {
|
||||
this.state = "failed";
|
||||
this.markFailed();
|
||||
this.fan({
|
||||
type: "info",
|
||||
level: "error",
|
||||
@@ -69,6 +69,9 @@ export class SessionBridge {
|
||||
|
||||
beginTurn(): void { this.state = "running"; }
|
||||
|
||||
/** Record a backend-detected failure; callers own any sanitized client message. */
|
||||
markFailed(): void { this.state = "failed"; }
|
||||
|
||||
onClientEvent(cb: (e: ClientEvent) => void): void { this.cbs.add(cb); }
|
||||
|
||||
/** Eventi generati dal backend stesso (es. exit inatteso del child Pi), non da Pi. */
|
||||
|
||||
Reference in New Issue
Block a user