(t *testing.T)
| 591 | } |
| 592 | |
| 593 | func TestHandler_LoadSession_V1Fallback(t *testing.T) { |
| 594 | // Store does NOT implement SessionStoreV2 — should fall back to v1 |
| 595 | logger := zap.NewNop() |
| 596 | store := &mockSessionStore{} |
| 597 | |
| 598 | history := []models.Message{ |
| 599 | {Role: "user", Content: "hello"}, |
| 600 | } |
| 601 | store.On("LoadSession", "test-v1").Return(history, nil) |
| 602 | |
| 603 | handler := &Handler{ |
| 604 | sessionManager: store, |
| 605 | logger: logger, |
| 606 | } |
| 607 | |
| 608 | resp, err := handler.LoadSession(context.Background(), &pb.LoadSessionRequest{Name: "test-v1"}) |
| 609 | assert.NoError(t, err) |
| 610 | assert.Len(t, resp.Messages, 1) |
| 611 | assert.Nil(t, resp.SessionData) // No v2 data from v1 store |
| 612 | } |
| 613 | |
| 614 | func TestProtoModelV2Roundtrip(t *testing.T) { |
| 615 | // Test that converting models → proto → models preserves all data including Meta |
nothing calls this directly
no test coverage detected