(t *testing.T, sess *session.Session, fake *fakeRuntime)
| 70 | func (f *fakeRuntime) SupportsModelSwitching() bool { return false } |
| 71 | |
| 72 | func newTestSessionManager(t *testing.T, sess *session.Session, fake *fakeRuntime) *SessionManager { |
| 73 | t.Helper() |
| 74 | |
| 75 | ctx := t.Context() |
| 76 | store := session.NewInMemorySessionStore() |
| 77 | require.NoError(t, store.AddSession(ctx, sess)) |
| 78 | |
| 79 | sm := &SessionManager{ |
| 80 | runtimeSessions: concurrent.NewMap[string, *activeRuntimes](), |
| 81 | deletedSessions: concurrent.NewMap[string, *activeRuntimes](), |
| 82 | followUpInjectors: concurrent.NewMap[string, FollowUpInjector](), |
| 83 | followUpKeys: concurrent.NewMap[string, *idempotencyCache](), |
| 84 | sessionStore: store, |
| 85 | Sources: config.Sources{}, |
| 86 | runConfig: &config.RuntimeConfig{}, |
| 87 | sessionReady: make(chan struct{}), |
| 88 | } |
| 89 | |
| 90 | // Pre-register a runtime for this session so RunSession skips agent loading. |
| 91 | sm.runtimeSessions.Store(sess.ID, &activeRuntimes{ |
| 92 | runtime: fake, |
| 93 | session: sess, |
| 94 | titleGen: (*sessiontitle.Generator)(nil), |
| 95 | }) |
| 96 | |
| 97 | return sm |
| 98 | } |
| 99 | |
| 100 | // TestAttachRuntime_RegistersRuntimeForExternalDriver verifies that a |
| 101 | // pre-built runtime is reachable through the manager API after AttachRuntime. |
no test coverage detected