feat(sessions): route chat messages through the intent-aware backend entry point
Replace the chat window's unconditional create-session-then-send flow with a single call to the new POST /sessions/messages endpoint: a plain "salut ça va ?" no longer starts a fake training session, since the backend's intent router decides that now. Add sessions.routeMessage to the IPC/preload surface and the sessions HTTP client. useSessionStore.sendMessage only sets sessionId/status (fetched fresh via sessions:get) when the backend actually reports type: "learn". The stepper-window-open + status-broadcast trigger in main/index.ts moves from sessions:create's handler to sessions:route-message's, since session creation now happens inside the backend's routing logic rather than via an explicit prior call. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
ce25d3f290
commit
7179743d4e
@@ -4,6 +4,7 @@ import type { VoiceTurnResult } from '../shared/voice'
|
||||
import type { AuthStatus, LoginResult } from '../shared/auth'
|
||||
import type {
|
||||
ObjectiveMessageResponse,
|
||||
RouteMessageResponse,
|
||||
SessionObjectiveResponse,
|
||||
SessionResponse,
|
||||
SessionStatus
|
||||
@@ -76,7 +77,9 @@ const api = {
|
||||
sendObjectiveMessage: (id: number, message: string): Promise<ObjectiveMessageResponse> =>
|
||||
ipcRenderer.invoke('sessions:send-objective-message', id, message),
|
||||
confirmObjective: (id: number): Promise<SessionObjectiveResponse> =>
|
||||
ipcRenderer.invoke('sessions:confirm-objective', id)
|
||||
ipcRenderer.invoke('sessions:confirm-objective', id),
|
||||
routeMessage: (message: string): Promise<RouteMessageResponse> =>
|
||||
ipcRenderer.invoke('sessions:route-message', message)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user