fix(coding): serialize agent server sleep restart
This commit is contained in:
@@ -498,6 +498,7 @@ export function createCodingComposition(
|
||||
await Promise.allSettled(conversationIds.map((conversationId) => (
|
||||
runtime.dispose(conversationId, reason)
|
||||
)));
|
||||
if (reason === 'background_sleep' && runtime.hasActiveWork()) return;
|
||||
await agentServer.stop();
|
||||
},
|
||||
async shutdown() {
|
||||
|
||||
@@ -490,6 +490,7 @@ export class PiAgentServerProcess {
|
||||
}
|
||||
|
||||
start(): Promise<void> {
|
||||
if (this.stopFlight) return this.stopFlight.then(() => this.start());
|
||||
if (this.startFlight) return this.startFlight;
|
||||
if (this.child && !this.failure) return Promise.resolve();
|
||||
this.startFlight = this.startServer().finally(() => {
|
||||
|
||||
Reference in New Issue
Block a user