(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestContextWithRunRoundTrip(t *testing.T) { |
| 14 | t.Parallel() |
| 15 | |
| 16 | rc := &chatdebug.RunContext{ |
| 17 | RunID: uuid.New(), |
| 18 | ChatID: uuid.New(), |
| 19 | RootChatID: uuid.New(), |
| 20 | ParentChatID: uuid.New(), |
| 21 | ModelConfigID: uuid.New(), |
| 22 | TriggerMessageID: 11, |
| 23 | HistoryTipMessageID: 22, |
| 24 | Kind: chatdebug.KindChatTurn, |
| 25 | Provider: "anthropic", |
| 26 | Model: "claude-sonnet", |
| 27 | } |
| 28 | |
| 29 | ctx := chatdebug.ContextWithRun(context.Background(), rc) |
| 30 | got, ok := chatdebug.RunFromContext(ctx) |
| 31 | require.True(t, ok) |
| 32 | require.Same(t, rc, got) |
| 33 | require.Equal(t, *rc, *got) |
| 34 | } |
| 35 | |
| 36 | func TestRunFromContextAbsent(t *testing.T) { |
| 37 | t.Parallel() |
nothing calls this directly
no test coverage detected