M1: snapshot carries session_id and outcome_pending
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user