mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-02 06:20:29 +00:00
feat: compact command with auto-compact
This commit is contained in:
parent
364cf5b429
commit
49423da081
16 changed files with 507 additions and 73 deletions
|
|
@ -9,6 +9,12 @@ FROM messages
|
|||
WHERE session_id = ?
|
||||
ORDER BY created_at ASC;
|
||||
|
||||
-- name: ListMessagesBySessionAfter :many
|
||||
SELECT *
|
||||
FROM messages
|
||||
WHERE session_id = ? AND created_at > ?
|
||||
ORDER BY created_at ASC;
|
||||
|
||||
-- name: CreateMessage :one
|
||||
INSERT INTO messages (
|
||||
id,
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ INSERT INTO sessions (
|
|||
prompt_tokens,
|
||||
completion_tokens,
|
||||
cost,
|
||||
summary,
|
||||
summarized_at,
|
||||
updated_at,
|
||||
created_at
|
||||
) VALUES (
|
||||
|
|
@ -17,6 +19,8 @@ INSERT INTO sessions (
|
|||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
?,
|
||||
strftime('%s', 'now'),
|
||||
strftime('%s', 'now')
|
||||
) RETURNING *;
|
||||
|
|
@ -38,7 +42,9 @@ SET
|
|||
title = ?,
|
||||
prompt_tokens = ?,
|
||||
completion_tokens = ?,
|
||||
cost = ?
|
||||
cost = ?,
|
||||
summary = ?,
|
||||
summarized_at = ?
|
||||
WHERE id = ?
|
||||
RETURNING *;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue