chore(lint): add explicit returns in then() callbacks in server

This commit is contained in:
Mohamed Boudra
2026-04-24 03:07:31 +07:00
parent eabaf3508e
commit 32255cef9a
13 changed files with 16 additions and 0 deletions

View File

@@ -3769,6 +3769,7 @@ export class DaemonClient {
.arrayBuffer()
.then((buffer) => {
this.handleTransportMessage(buffer);
return;
})
.catch(() => {
// Ignore failed blob decoding and allow reconnect logic to recover.

View File

@@ -1914,6 +1914,7 @@ export class AgentManager {
permission,
lastMessage,
});
return;
})
.catch(reject);
};
@@ -2191,6 +2192,7 @@ export class AgentManager {
return;
}
await this.dispatchSessionEvent(current, event);
return;
})
.catch((err) => {
this.logger.error(

View File

@@ -140,6 +140,7 @@ export class AgentStorage {
this.cache.set(agentId, record);
this.pathById.set(agentId, nextPath);
return;
});
this.pendingWrites.set(

View File

@@ -123,6 +123,7 @@ async function startTurnAndCollectEvents(
.startTurn(prompt)
.then((result) => {
turnId = result.turnId;
return;
})
.catch((error) => {
clearTimeout(timeout);
@@ -384,6 +385,7 @@ test("Test 5: Interruption", async () => {
return;
}
turnId = result.turnId;
return;
})
.catch((error) => {
clearTimeout(timeout);

View File

@@ -908,6 +908,7 @@ export class ACPAgentSession implements AgentSession, ACPClient {
})
.then((response) => {
this.handlePromptResponse(response, turnId);
return;
})
.catch((error) => {
const message = error instanceof Error ? error.message : String(error);

View File

@@ -2057,6 +2057,7 @@ class OpenCodeAgentSession implements AgentSession {
turnId,
);
}
return;
})
.catch((err) => {
if (isOpenCodeHeadersTimeoutFailure(err)) {
@@ -2105,6 +2106,7 @@ class OpenCodeAgentSession implements AgentSession {
turnId,
);
}
return;
})
.catch((error) => {
this.finishForegroundTurn(

View File

@@ -317,6 +317,7 @@ export class TTSManager {
if (result.kind === "prepared") {
this.destroySpeechStream(result.prepared.stream);
}
return;
});
}
}

View File

@@ -885,6 +885,7 @@ export class LoopService {
left.createdAt.localeCompare(right.createdAt),
);
await fs.writeFile(this.storePath, JSON.stringify(records, null, 2), "utf8");
return;
});
this.persistQueue = nextPersist.catch(() => {});
await nextPersist;

View File

@@ -961,6 +961,7 @@ class FakeAgentSession implements AgentSession {
let interrupted = false;
const interrupt = this.interruptSignal.promise.then(() => {
interrupted = true;
return;
});
await Promise.race([interrupt, new Promise((r) => setTimeout(r, 500))]);
if (!interrupted) {

View File

@@ -59,6 +59,7 @@ async function startDaemonWithTimeout(
() => {
clearTimeout(timeoutHandle);
resolve();
return;
},
(error) => {
clearTimeout(timeoutHandle);

View File

@@ -89,6 +89,7 @@ export function createVoiceTurnController(params: {
submissionQueue = submissionQueue
.then(async () => {
await params.utteranceSink.submitUtterance(utterance);
return;
})
.catch((error) => {
fail(error);

View File

@@ -614,6 +614,7 @@ export async function runAsyncWorktreeBootstrap(
"Failed to emit live worktree setup timeline update",
);
}
return;
});
};

View File

@@ -1557,6 +1557,7 @@ export function warmCheckoutShortstatInBackground(
void getOrLoadCheckoutShortstat(cwd, context)
.then(() => {
onComplete?.();
return;
})
.catch(() => {
// Non-critical: keep listing path resilient even if git commands fail.