Run tasks on Codex beside Claude; drop turn caps and mid-turn snapshots

This commit is contained in:
Ian Gulliver
2026-10-15 14:55:58 -07:00
parent 17898b0191
commit 74707f6398
53 changed files with 1904 additions and 1295 deletions
+26
View File
@@ -286,6 +286,9 @@ UPDATE tasks SET color = (SELECT count(*) FROM tasks AS earlier WHERE earlier.ro
UPDATE tasks SET color = (
SELECT count(*) FROM tasks AS earlier WHERE earlier.status = 'active' AND earlier.rowid < tasks.rowid
) % 11 WHERE status = 'active';
`}, {"drop-turn-queue", `
UPDATE agent_sessions SET state = 'idle' WHERE state = 'queued';
DROP TABLE turn_queue;
`}}
const (
@@ -1017,6 +1020,29 @@ func (s *Store) transitionSession(ctx context.Context, id string, from *api.Agen
})
}
func (s *Store) SessionStarted(ctx context.Context, sessionID string) (bool, error) {
started := false
err := s.db.QueryRowContext(ctx, `SELECT EXISTS (SELECT 1 FROM events WHERE agent_session_id = ? AND kind = 'user.message')`, sessionID).Scan(&started)
return started, err
}
func (s *Store) SetVendorSessionID(ctx context.Context, id, vendorSessionID string) error {
return s.write(ctx, func(tx *sql.Tx, emit emitFunc) error {
res, err := tx.ExecContext(ctx, `UPDATE agent_sessions SET vendor_session_id = ? WHERE id = ?`, vendorSessionID, id)
if err != nil {
return err
}
n, err := res.RowsAffected()
if err != nil {
return err
}
if n == 0 {
return ErrNotFound
}
return nil
})
}
func (s *Store) SetSessionModel(ctx context.Context, id, model, actor string) error {
return s.write(ctx, func(tx *sql.Tx, emit emitFunc) error {
taskID := ""