Marks orphaned in-progress rows as interrupted so they do not stay in a non-terminal state forever. The NOT IN list must match the terminal statuses defined by ChatDebugStatus in codersdk/chats.go. The steps CTE also catches steps whose parent run was just finalized (via run_id IN), because Postgre
(ctx context.Context, arg FinalizeStaleChatDebugRowsParams)
| 251 | // @now is the caller's clock timestamp so that mock-clock tests stay |
| 252 | // consistent with the @updated_before cutoff. |
| 253 | FinalizeStaleChatDebugRows(ctx context.Context, arg FinalizeStaleChatDebugRowsParams) (FinalizeStaleChatDebugRowsRow, error) |
| 254 | // FindMatchingPresetID finds a preset ID that is the largest exact subset of the provided parameters. |
| 255 | // It returns the preset ID if a match is found, or NULL if no match is found. |
| 256 | // The query finds presets where all preset parameters are present in the provided parameters, |
no outgoing calls