M1: snapshot carries session_id and outcome_pending

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 12:42:35 -04:00
parent 5ee34a350d
commit 034cc16540
2 changed files with 21 additions and 0 deletions
+19
View File
@@ -48,3 +48,22 @@ func TestSaveThenLoadRoundTrips(t *testing.T) {
t.Errorf("deadline: got %d want %d", got.DeadlineUnixSecs, want.DeadlineUnixSecs)
}
}
func TestSnapshotCarriesSessionFields(t *testing.T) {
path := filepath.Join(t.TempDir(), "state.json")
want := Snapshot{
RuntimeState: domain.RuntimeActive,
SessionID: "session-abc",
OutcomePending: "completed",
}
if err := Save(path, want); err != nil {
t.Fatalf("save: %v", err)
}
got, err := Load(path)
if err != nil {
t.Fatalf("load: %v", err)
}
if got.SessionID != "session-abc" || got.OutcomePending != "completed" {
t.Fatalf("session fields did not round-trip: %+v", got)
}
}