This commit is contained in:
Andras Schmelczer 2026-04-26 12:46:12 +01:00
parent 8eae770621
commit 8b7be48522
13 changed files with 37 additions and 28 deletions

View file

@ -192,6 +192,10 @@ export class DeterministicAgent extends debugging.InMemoryFileSystem {
const isNew = !this.files.has(path);
await super.write(path, content);
if (!this.isSyncEnabled) {
return;
}
if (isNew) {
this.enqueueSync(async () => {
this.client.syncLocallyCreatedFile(path);
@ -208,9 +212,11 @@ export class DeterministicAgent extends debugging.InMemoryFileSystem {
updater: (current: TextWithCursors) => TextWithCursors
): Promise<string> {
const result = await super.atomicUpdateText(path, updater);
this.enqueueSync(async () => {
this.client.syncLocallyUpdatedFile({ relativePath: path });
});
if (this.isSyncEnabled) {
this.enqueueSync(async () => {
this.client.syncLocallyUpdatedFile({ relativePath: path });
});
}
return result;
}
@ -228,12 +234,14 @@ export class DeterministicAgent extends debugging.InMemoryFileSystem {
newPath: RelativePath
): Promise<void> {
await super.rename(oldPath, newPath);
this.enqueueSync(async () => {
this.client.syncLocallyUpdatedFile({
oldPath,
relativePath: newPath
if (this.isSyncEnabled) {
this.enqueueSync(async () => {
this.client.syncLocallyUpdatedFile({
oldPath,
relativePath: newPath
});
});
});
}
}
private async waitForWebSocket(): Promise<void> {

View file

@ -8,7 +8,7 @@ export function parseConcurrency(): number {
i + 1 < args.length
) {
const n = parseInt(args[i + 1], 10);
if (!isNaN(n) && n > 0) return n;
if (!isNaN(n) && n > 0) {return n;}
}
}
return os.cpus().length;

View file

@ -19,7 +19,7 @@ export class ServerManager {
}
public async stopAll(): Promise<void> {
if (this.isShuttingDown) return;
if (this.isShuttingDown) {return;}
this.isShuttingDown = true;
const servers = Array.from(this.activeServers);