Skip to content

attachRunToMessage

const attachRunToMessage: (sessionId, messageId, runId, alongside) => Promise<boolean> = sqliteRepo.attachRunToMessage

Defined in: src/lib/repositories/chat-history.ts:46

File a durable job against an assistant row a chat turn already owns, in one commit: the row gains the job’s id and the job’s own statement runs beside it.

The counterpart of appendRunTurn for work a model delegated from inside a turn. That turn wrote the request and the row, and is still streaming into it, so nothing here inserts a message or moves the leaf. Only an unclaimed assistant row of the named chat qualifies: a row already carrying a job keeps the one it has, and undefined leaves the decision to the caller, the same as a missing chat does above.

string

number

string

RunTurnStatement

Promise<boolean>