Изменение выносит типы контента в :content-api и разделяет потоки событий.
This commit is contained in:
+5
-1
@@ -60,6 +60,10 @@ class InMemoryOnlineOutbox(
|
||||
}
|
||||
|
||||
private companion object {
|
||||
private const val DEFAULT_LIVE_BUFFER_CAPACITY = 1
|
||||
// Достаточно, чтобы не терять подряд идущие маркеры фаз
|
||||
// (Working/StartReasoning/StartResponse) и первые дельты, пока
|
||||
// подписчик не возобновил сбор. Дельты токенов при переполнении
|
||||
// всё равно дропаются (DROP_OLDEST) — потеря фрагмента допустима.
|
||||
private const val DEFAULT_LIVE_BUFFER_CAPACITY = 64
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -164,7 +164,7 @@ class InMemoryOutboxStoreTest {
|
||||
store.append(CommonEvent.Conversation(
|
||||
date = now,
|
||||
conversationId = "c-1",
|
||||
event = Event.Working(date = now),
|
||||
event = Event.Interrupted(date = now),
|
||||
))
|
||||
|
||||
// Snapshot-based test of the default impl (uses events() + filterIsInstance).
|
||||
@@ -180,9 +180,9 @@ class InMemoryOutboxStoreTest {
|
||||
fun `conversationEvents with conversationId filters to that conversation`() = runBlocking {
|
||||
val store = InMemoryOutboxStore(maxMessages = null, ttl = null)
|
||||
val now = Instant.fromEpochSeconds(0)
|
||||
store.append(CommonEvent.Conversation(now, "c-1", Event.Working(now)))
|
||||
store.append(CommonEvent.Conversation(now, "c-2", Event.Working(now)))
|
||||
store.append(CommonEvent.Conversation(now, "c-1", Event.Working(now)))
|
||||
store.append(CommonEvent.Conversation(now, "c-1", Event.Interrupted(now)))
|
||||
store.append(CommonEvent.Conversation(now, "c-2", Event.Interrupted(now)))
|
||||
store.append(CommonEvent.Conversation(now, "c-1", Event.Interrupted(now)))
|
||||
|
||||
// Test the filter logic by manually filtering snapshot.
|
||||
val c1 = store.snapshot()
|
||||
@@ -200,7 +200,7 @@ class InMemoryOutboxStoreTest {
|
||||
date = now,
|
||||
event = AgentEvent.Created(date = now, conversationId = "created"),
|
||||
))
|
||||
store.append(CommonEvent.Conversation(now, "c-1", Event.Working(now)))
|
||||
store.append(CommonEvent.Conversation(now, "c-1", Event.Interrupted(now)))
|
||||
|
||||
val all = store.snapshot()
|
||||
val agents = all.filterIsInstance<CommonEvent.Agent>()
|
||||
|
||||
Reference in New Issue
Block a user