handle user event in formatEvent; remove manual appendChat for prompt

The 9p prompt handler no longer directly appends "user: ..." to the chat
log — that now arrives via the "user" event emitted by core's Submit,
which also fires for FIFO-drained queued prompts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Levi Neely 2026-04-11 17:37:12 +02:00
parent 8070238390
commit cd0818f1c9
1 changed files with 2 additions and 1 deletions

View File

@ -684,7 +684,6 @@ func (s *Server) handleWrite(path, input string) {
sess.appendChat([]byte("user (interrupt): " + input + "\n"))
return
}
sess.appendChat([]byte("user: " + input + "\n"))
// Clear reply before submission — documented side-effect.
sess.mu.Lock()
sess.reply = nil
@ -911,6 +910,8 @@ func (s *Server) killSession(id string) {
// what appears in the TUI chat pane.
func formatEvent(ev agent.Event) []byte {
switch ev.Role {
case "user":
return []byte("user: " + ev.Content + "\n")
case "assistant":
return []byte(ev.Content)
case "call":