From: Anderson A. Giacomolli Date: Sat, 7 Nov 2026 02:07:05 +0000 (-0300) Subject: Serve the agent to a terminal client X-Git-Url: http://git.giacomolli.uk/onechat/commitdiff_plain/97274864799ac2eea84bf80c9727a810b695db55?ds=sidebyside;hp=97274864799ac2eea84bf80c9727a810b695db55 Serve the agent to a terminal client onechat daemon owns the root agent in agent/ in the data directory: its config, chat, compactor, and loop. It listens on the Unix socket onechat.sock in the data directory, with mode 0600, and sends each event to every client as a JSON line: ready with the agent's name on connect, busy and idle around each turn, each logged message, and errors. A client sends JSON lines too: send with a message, or interrupt. A slow client is dropped, so it never stops the agent. onechat chat is a line-based client without a terminal library. Each input line is a message, the line /stop interrupts the turn, and the end of the input ends the client. It shows the replies, the tool calls, and the first 10 lines of each result as they happen. The daemon, login, and probe each hold a lock on auth.lock in the data directory while they run, so only one process reads and refreshes the tokens. Two processes that refresh one token file rotate the refresh token of each other and log each other out. The client never reads the token file. Issue: 5daf23e ---