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
+1 -23
View File
@@ -3,7 +3,6 @@ package store_test
import (
"context"
"path/filepath"
"slices"
"testing"
"time"
@@ -11,7 +10,7 @@ import (
"g.fc.run/misc/byre/internal/store"
)
func TestQueuedTurnKeepsImages(t *testing.T) {
func TestBlobRoundTrip(t *testing.T) {
ctx := context.Background()
st, err := store.Open(filepath.Join(t.TempDir(), "byre.db"), store.DefaultPortFirst, func(api.Event) {})
if err != nil {
@@ -28,15 +27,6 @@ func TestQueuedTurnKeepsImages(t *testing.T) {
if err != nil {
t.Fatalf("create project: %v", err)
}
err = st.CreateTask(ctx, api.Task{Id: "t1", ProjectId: "p1", Title: "t1", Branch: "t1", WorktreePath: "/nonexistent", BaseRef: "x", Status: api.TaskStatusActive, CreatedBy: "alice", CreatedAt: now}, "alice")
if err != nil {
t.Fatalf("create task: %v", err)
}
err = st.CreateSession(ctx, api.AgentSession{Id: "s1", TaskId: "t1", Vendor: api.Claude, VendorSessionId: "s1", State: api.AgentSessionStateIdle, Role: api.Implementer, CreatedBy: "alice", CreatedAt: now}, "p1")
if err != nil {
t.Fatalf("create session: %v", err)
}
b, err := st.CreateBlob(ctx, "image/png", []byte("not really a png"), "alice")
if err != nil {
t.Fatalf("create blob: %v", err)
@@ -48,16 +38,4 @@ func TestQueuedTurnKeepsImages(t *testing.T) {
if got.ContentType != "image/png" || got.CreatedBy != "alice" || string(data) != "not really a png" {
t.Fatalf("blob round trip: %+v %q", got, data)
}
err = st.EnqueueTurn(ctx, store.QueuedTurn{SessionID: "s1", Actor: "alice", Text: "look", Images: []string{b.Id}, CreatedAt: now})
if err != nil {
t.Fatalf("enqueue: %v", err)
}
queued, err := st.QueuedTurns(ctx)
if err != nil {
t.Fatalf("queued turns: %v", err)
}
if len(queued) != 1 || !slices.Equal(queued[0].Images, []string{b.Id}) {
t.Fatalf("queued turn lost its images: %+v", queued)
}
}