feat(router,server): wire workflow inventory and project profile into router context per turn
This commit is contained in:
@@ -26,6 +26,7 @@ import com.correx.core.router.l3.L3Query
|
||||
import com.correx.core.router.model.NarrationTrigger
|
||||
import com.correx.core.router.model.RouterConfig
|
||||
import com.correx.core.router.model.RouterResponse
|
||||
import com.correx.core.router.model.WorkflowSummary
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.datetime.Clock
|
||||
import org.slf4j.LoggerFactory
|
||||
@@ -52,6 +53,8 @@ class DefaultRouterFacade(
|
||||
private val validateSteering: (suspend (String) -> String?)? = null,
|
||||
private val embedder: Embedder,
|
||||
private val l3MemoryStore: L3MemoryStore,
|
||||
private val workflowSummaryProvider: () -> List<WorkflowSummary> = { emptyList() },
|
||||
private val sessionProfileProvider: suspend (SessionId) -> String? = { null },
|
||||
) : RouterFacade {
|
||||
|
||||
override suspend fun onUserInput(
|
||||
@@ -115,7 +118,7 @@ class DefaultRouterFacade(
|
||||
// Rebuild state so lastRetrievedMemory reflects this turn
|
||||
state = routerRepository.getRouterState(sessionId)
|
||||
|
||||
val contextPack = routerContextBuilder.build(state, config.tokenBudget)
|
||||
val contextPack = routerContextBuilder.build(state, config.tokenBudget, workflowSummaryProvider(), sessionProfileProvider(sessionId))
|
||||
|
||||
if (contextPack.compressionMetadata.entriesDropped > 0) {
|
||||
val truncNow = Clock.System.now()
|
||||
|
||||
Reference in New Issue
Block a user