fix: address P0-4 chat zombie, P0-5 double SessionStarted, P0-6 steering wrong content

This commit is contained in:
2026-05-28 23:10:29 +04:00
parent cdee5f2245
commit eed557fe9c
8 changed files with 47 additions and 83 deletions
@@ -1,10 +1,6 @@
package com.correx.core.router
import com.correx.core.events.events.EventMetadata
import com.correx.core.events.events.NewEvent
import com.correx.core.events.events.SteeringNoteAddedEvent
import com.correx.core.events.stores.EventStore
import com.correx.core.events.types.EventId
import com.correx.core.events.types.InferenceRequestId
import com.correx.core.events.types.SessionId
import com.correx.core.events.types.StageId
@@ -71,24 +67,11 @@ class DefaultRouterFacade(
history.add(RouterTurn(role = TurnRole.ROUTER, content = content, timestamp = Clock.System.now()))
if (mode == ChatMode.STEERING) {
val steeringEvent = SteeringNoteAddedEvent(
sessionId = sessionId,
content = input,
stageId = state.currentStageId,
)
eventStore.append(NewEvent(
metadata = EventMetadata(
eventId = EventId(UUID.randomUUID().toString()),
sessionId = sessionId,
timestamp = Clock.System.now(),
schemaVersion = 1,
causationId = null,
correlationId = null,
),
payload = steeringEvent,
))
}
// NOTE: SteeringNoteAddedEvent emission is deferred to P4-1, which will wire
// proper validation (via ValidationPipeline) and consumption by the context builder.
// The current SteeringNoteAddedEvent had wrong content (user raw input instead of
// LLM-processed steering text) and was emitted without validation (P0-6).
// The steeringEmitted flag below still informs the TUI that steering mode was used.
return RouterResponse(content = content, steeringEmitted = (mode == ChatMode.STEERING))
}