Fix runtime memory review issues

Address runtime memory review feedback around sqlite compatibility, shutdown ordering, and endpoint validation.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Harivansh Rathi 2026-03-08 16:20:56 -07:00
parent 9c5dde8615
commit 9e11f49d17
3 changed files with 171 additions and 52 deletions

View file

@ -698,15 +698,23 @@ export class GatewayRuntime {
if (method === "POST" && path === "/memory/forget") {
const body = await this.readJsonBody(request);
const id =
typeof body.id === "number" && Number.isFinite(body.id)
? Math.floor(body.id)
: undefined;
const key = typeof body.key === "string" ? body.key : undefined;
if (id === undefined && !key) {
this.writeJson(response, 400, {
error: "Memory forget requires an id or key",
});
return;
}
const sessionKey =
typeof body.sessionKey === "string" ? body.sessionKey : undefined;
const memorySession = await this.resolveMemorySession(sessionKey);
const result = await memorySession.forgetMemory({
id:
typeof body.id === "number" && Number.isFinite(body.id)
? Math.floor(body.id)
: undefined,
key: typeof body.key === "string" ? body.key : undefined,
id,
key,
});
this.writeJson(response, 200, result);
return;