Skip to content

Using it

There are four ways to reach the desks. The table below compares them.

Way Best for Page
The web page at http://127.0.0.1:8120 Watching everything, editing your files, controlling desks and apps The web page
The terminal program, bin/trading-agent Everything the web page does, in a terminal, with Claude Code's keys The terminal program
Telegram Alerts and quick commands away from the computer Telegram
The trading-agent subcommands and -p Scripts, setup and checks Commands

Talking to a desk works the same everywhere: a message becomes a turn, a slash command is answered by code, and a message sent while the desk is working steers the running turn. Talking to a desk explains it. A desk can also ask you a question, show you a plan, or wait for your permission before certain actions, in the web chat, the terminal and on Telegram alike; Questions, plans and permissions explains how.

A message to a desk and its answer You send a message over HTTP; the gateway checks the token, queues a trigger for the desk, the desk runs the turn, and every step is published on the event bus and streamed back over the WebSocket. trading-agent gateway: one process, uvicorn on 127.0.0.1:8120 1 Check the access token wrong or missing token → 401 · desk that does not exist → 404 2 Queue a trigger for desk "general" the POST returns at once: 202 and the new trigger_id 3 The desk takes its next trigger one turn at a time; every desk has its own queue 4 Run the turn its model answers, calling tools as it needs 5 Publish events on the event bus trigger_received · turn_started · text · turn_finished 6 Stream them over the WebSocket /ws/events notices when you hang up; the token is hidden in logs You POST /api/desks/general/messages events arrive live, as JSON: trigger_received turn_started text (the reply) turn_finished Other listeners each gets its own queue the journal, the web page, Telegram, hooks Outside the flow trading_agent.toml checked at start, typos rejected trading-agent doctor 8 checks of this machine your message going in events coming back out The POST and the WebSocket are separate connections: the reply is never the POST's answer, it arrives as events.
The orange dot is a message going in through the gateway to a desk; the blue dot is every step of the desk's turn coming back as events, to the page and to every other listener such as the journal.