diff --git a/src/gateway/rpc-methods.ts b/src/gateway/rpc-methods.ts index 807308a6..4acf6264 100644 --- a/src/gateway/rpc-methods.ts +++ b/src/gateway/rpc-methods.ts @@ -2244,6 +2244,17 @@ export function createRpcMethods( } } + // Save steer message to DB (like chat.send saves the initial user message) + if (chatRepo) { + const effectiveSessionId = sessionId ?? stream.sessionId; + await chatRepo.appendMessage({ + sessionId: effectiveSessionId, + role: "user", + content: text, + }); + await chatRepo.incrementMessageCount(effectiveSessionId); + } + const client = new AgentBoxClient(stream.endpoint, 30000, agentBoxTlsOptions); await client.steerSession(stream.sessionId, text); return { status: "steered" }; diff --git a/src/gateway/web/src/hooks/usePilot.ts b/src/gateway/web/src/hooks/usePilot.ts index 423c7b3f..310941da 100644 --- a/src/gateway/web/src/hooks/usePilot.ts +++ b/src/gateway/web/src/hooks/usePilot.ts @@ -789,7 +789,13 @@ export function usePilot() { if (isLoading) { try { await sendRpc('chat.steer', { text, sessionId: currentSessionKeyRef.current }); - setPendingMessages(prev => [...prev, text]); + // Show steer message in chat immediately (same as normal send) + setMessages(prev => [...prev, { + id: `user-${Date.now()}`, + role: 'user' as const, + content: text, + timestamp: new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }), + }]); } catch (err) { console.error('Failed to steer:', err); }