package codex import ( "context" "testing" "amadan.net/oficina/equipo/internal/runner/provider" ) func TestCodexFirstTurnDoesNotResumeUnpersistedThread(t *testing.T) { f := fixtureFor(t) f.host.set("unpersisted") s, events := openFixture(t, f) for _, id := range []string{"first", "second"} { if err := f.l.StartTurn(context.Background(), s, provider.Turn{ID: id, AdmissionID: id, Prompt: "ready"}); err != nil { t.Fatal(err) } if ev := terminal(t, events); ev.Kind != "turn.completed" { t.Fatal(ev) } } if f.host.count("thread/start") != 1 || f.host.count("thread/resume") != 1 || f.host.count("turn/start") != 2 { t.Fatal("thread lifecycle not preserved") } }