(limit = 20, cwd?: string)
| 257 | if (hasUserMessage) { |
| 258 | this.updateSessionWithTurn.run(usage.input, usage.output, usage.costUsd, title ?? null, sessionId); |
| 259 | } else { |
| 260 | this.updateSessionNoTurn.run(usage.input, usage.output, usage.costUsd, sessionId); |
| 261 | } |
| 262 | }); |
| 263 | tx(); |
| 264 | } |
| 265 | |
| 266 | private getCurrentTurnNumber(sessionId: string): number { |
| 267 | const row = this.db.prepare( |
| 268 | `SELECT MAX(turn_number) as max FROM messages WHERE session_id = ?`, |
| 269 | ).get(sessionId) as { max: number | null }; |
| 270 | return row.max ?? 0; |
| 271 | } |
no outgoing calls
no test coverage detected