mirror of
https://github.com/harivansh-afk/clanker-agent.git
synced 2026-04-16 16:01:01 +00:00
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:
parent
9c5dde8615
commit
9e11f49d17
3 changed files with 171 additions and 52 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue