fix(gateway): await reset handler result in agent route

This commit is contained in:
Vignesh Natarajan
2026-02-14 19:29:32 -08:00
parent 2c8b921054
commit a3e2d0563e

View File

@@ -127,8 +127,9 @@ async function runSessionResetFromAgent(params: {
respond,
});
void Promise.resolve(resetResult)
.then(() => {
void (async () => {
try {
await resetResult;
if (!settled) {
settle({
ok: false,
@@ -138,13 +139,13 @@ async function runSessionResetFromAgent(params: {
),
});
}
})
.catch((err: unknown) => {
} catch (err: unknown) {
settle({
ok: false,
error: errorShape(ErrorCodes.UNAVAILABLE, String(err)),
});
});
}
})();
});
}