feature(event-sourcing): baseline for the architecture review fixes.

- fixed the tool overlay in tui.
- fixed tool calling - added schemas.
- getting all sessionIds via event store.
- instead of sending all events on the replay - there's a new way for replaying.
- session snapshot is now a thing getting sent for previously created sessions.
- added logging to important parts.
- revert workflowId from WorkflowCompletedEvent.
This commit is contained in:
2026-05-24 18:50:00 +04:00
parent f827685ed0
commit fc7b879891
43 changed files with 525 additions and 211 deletions
@@ -26,7 +26,9 @@ class DefaultApprovalReducer : ApprovalReducer {
timestamp = event.metadata.timestamp,
causationId = event.metadata.causationId,
correlationId = event.metadata.correlationId,
userSteering = payload.userSteering
userSteering = payload.userSteering,
toolName = payload.toolName,
preview = payload.preview,
)
state.copy(requests = state.requests + (request.id to request))
}
@@ -39,11 +41,11 @@ class DefaultApprovalReducer : ApprovalReducer {
identity = ApprovalScopeIdentity(
sessionId = event.metadata.sessionId,
stageId = null,
projectId = null
projectId = null,
),
mode = ApprovalMode.PROMPT,
causationId = event.metadata.causationId,
correlationId = event.metadata.correlationId
correlationId = event.metadata.correlationId,
)
val decision = ApprovalDecision(
id = decisionId,
@@ -54,7 +56,7 @@ class DefaultApprovalReducer : ApprovalReducer {
contextSnapshot = contextSnapshot,
resolutionTimestamp = payload.resolutionTimestamp,
reason = payload.reason,
userSteering = payload.userSteering
userSteering = payload.userSteering,
)
state.copy(decisions = state.decisions + (decisionId to decision))
}
@@ -66,7 +68,7 @@ class DefaultApprovalReducer : ApprovalReducer {
permittedTiers = payload.permittedTiers,
reason = payload.reason,
timestamp = event.metadata.timestamp,
expiresAt = payload.expiresAt
expiresAt = payload.expiresAt,
)
state.copy(grants = state.grants + (grant.id to grant))
}
@@ -19,5 +19,7 @@ data class DomainApprovalRequest(
val timestamp: Instant,
val causationId: CausationId? = null,
val correlationId: CorrelationId? = null,
val userSteering: UserSteering? = null
val userSteering: UserSteering? = null,
val toolName: String? = null,
val preview: String? = null,
)