Repository navigation
architecture server
The solomon server process is a user-scoped, detached local service. It can be started manually or on demand by the desktop client; it is not tied to a workspace, a shell, or the current working directory.
- Serve the local web surface.
- Provide a localhost API boundary for the GUI and machine interactions.
- Own the GUI-facing project, chat, image and streaming endpoints.
- Supervise child processes required by the active mode, including daemon-owned PTY sessions.
In addition to GET /health, the server exposes the project, chat, customization,
model and terminal APIs below. A chat run constructs the same
internal/agent/runtime.Runtime used by solomon exec --json; the GUI receives
its machine events over an SSE stream and reads the persisted session for the
final snapshot. The run belongs to the daemon, not to an individual HTTP
connection: a browser reload only closes its SSE subscription, and a later
/events subscription replays the buffered events. Only the explicit stop
endpoint or daemon shutdown cancels the run. Distinct chats can run concurrently
across projects.
| Route | Purpose |
|---|---|
GET /__solomon/projects |
List registered projects, chat summaries and project stats. |
POST /__solomon/projects |
Register a local folder as a project. |
POST /__solomon/projects/<project>/chats |
Create an empty persisted chat. |
GET /__solomon/projects/<project>/chats/<chat> |
Open a persisted chat and map its transcript for the GUI. |
POST /__solomon/projects/<project>/chats/<chat>/messages |
Run a prompt and stream runtime events as SSE. |
GET /__solomon/projects/<project>/chats/<chat>/events?starting_after=N |
Attach to an active run and replay events after sequence N; returns the persisted snapshot when no run is active. |
DELETE /__solomon/projects/<project>/chats/<chat>/messages/<message> |
Delete a user turn and its following assistant/tool records. |
POST /__solomon/projects/<project>/chats/<chat>/stop |
Interrupt the active chat run. |
GET /__solomon/projects/<project>/chats/<chat>/images/<seq> |
Serve a validated persisted chat image. |
GET/POST /__solomon/projects/<project>/subchats/<subchat> |
Read or control a persisted subagent chat. |
GET /__solomon/projects/<project>/files?path=... |
List one directory level inside a registered project. |
GET /__solomon/projects/<project>/{branches,history,status,worktrees} |
Read project Git state. |
POST /__solomon/projects/<project>/checkout |
Checkout an existing project branch. |
GET /__solomon/projects/<project>/research |
List persisted research jobs. |
GET /__solomon/projects/<project>/research/<id>/report |
Return the persisted HTML report for a research job. |
GET /__solomon/home-directories?path=... |
List one directory level under the user home. |
GET /__solomon/filesystem-directories?path=... |
Browse the local filesystem for the new-project folder picker. |
Customization, model and terminal routes are also daemon-owned:
| Route | Purpose |
|---|---|
/__solomon/rules, /__solomon/skills, /__solomon/mcps, /__solomon/subagents
|
Read global customization catalogs. |
/__solomon/rules/*, /__solomon/subagents/*, /__solomon/roles-table, /__solomon/promptTemplate*
|
Mutate customization and prompt-template state. |
GET /__solomon/models |
Read configured providers, models and visibility. |
PUT /__solomon/current-model, PUT /__solomon/model-visibility, POST /__solomon/connect-provider
|
Change model/provider configuration. |
GET /__solomon/terminal?path=... (WebSocket upgrade) |
Attach to a daemon-owned shell PTY with replay and resize. Add mode=tui for the Solomon REPL. |
The browser and Wails GUI use these same daemon routes. The Vite middleware
contains a development fallback for opening the frontend directly, but it is not
the ownership boundary for a server-backed client; the Wails bridge exposes a private loopback gateway that forwards API requests,
SSE streams and WebSockets to the current daemon. The gateway follows daemon
state after a restart and adapts native wails://wails origins for older daemons.
Closing the desktop window closes this gateway, while daemon-owned work continues.
| Command | Behavior |
|---|---|
solomon server start |
Start the detached server in normal mode. |
solomon server start dev <gui-directory> |
Start or switch to development mode. Reuse existing GUI sources, or initialize a base inside an empty/new chosen folder. |
solomon server customize [gui-directory] |
Prepare GUI sources and dependencies, then switch the running daemon to hot reload without interrupting chats or terminals. Omit the directory to export sources from the installed binary. |
solomon server start normal |
Start with the bundled frontend, or restore it on the running daemon without a restart. |
solomon server status |
Print the PID, local and network URLs, mode, version, Vite status, development GUI source directory when in dev/HMR mode, and start time. |
solomon server stop |
POST /_solomon/stop, wait for shutdown, then remove runtime state. If health fails or the process does not exit in time, the CLI force-stops the recorded server and Vite process groups and clears stale state.json. |
solomon server restart |
Preserve the prior mode and development directory, then restart. |
solomon server logs |
Print the recent server log. |
solomon server logs interactive |
Continue streaming the server log until interrupted. |
make install, make hot-install and make desktop-install prepare the CLI, frontend and native client before the coordinated runtime handoff. Deployment stops the daemon and clients, replaces the installation, then restarts the prior mode and reopens clients; preparation failures leave the existing runtime running.
solomon server status reports stopped when state.json is missing or /health fails. After a crash or interrupted shutdown, the next start/stop reclaims the recorded server and Vite process groups before clearing stale state.
The server listens on the TCP port in server_port in ~/.solomon/config.toml. An explicit SOLOMON_SERVER_PORT environment value takes precedence and is persisted back to that field; .env is loaded by both server start and server run. A missing value uses the deterministic default 64000; the server never selects an ephemeral port. It listens on all IPv4 interfaces by default. solomon server start and solomon server status print the loopback URLs plus every discovered non-loopback IPv4 address. Addresses in the local network, or on another active IPv4 interface, are labelled local; Tailscale addresses in 100.64.0.0/10 are labelled tailscale. The same list is stored in state.json and returned by GET /health.
The server currently has no authentication layer. Binding to network interfaces therefore makes the GUI, API and PTY reachable by other devices that can access the host; use the host firewall and Tailscale ACLs to limit access to trusted clients. Browser API requests and terminal upgrades reject unrelated origins, but this is not a substitute for authentication on an untrusted network.
GET /health returns JSON with ok, server PID/version/mode/URLs, the discovered addresses list, start time, Go runtime details, Vite status, Vite process-group leader PID and development directory when present, plus the existing API, GUI and worker readiness fields. It is the readiness check used by the CLI.
make gui-build stages the Vite output for embedding in the CLI and native
desktop client. In normal mode the server serves those assets and the React
entry point for client-side routes. /settings opens the settings page.
Chat, models, and docs stay on that page. Missing static assets return 404. Health
reports API and workers as ready, and GUI as ready when a compiled bundle
or development frontend is available.
When asked to personalize Solomon's interface in chat, the agent uses the native
customizeUI tool with action=dev. It exports the installed version's frontend,
shared welcome logo and documentation under SOLOMON_HOME/customization, installs
dependencies with npm ci --include=dev (or npm install --include=dev when no
lockfile exists), and starts Vite before replacing the frontend handler. Node.js
and npm must be installed; a preparation failure leaves the working interface
and saved startup preferences intact. Existing customization files are reused
without overwriting them. The tool returns the source directory for subsequent
file edits and HMR.
GET /__solomon/development reports the live frontend. POST accepts
{"mode":"dev","directory":"optional GUI path"} or {"mode":"normal"}.
Advanced settings provide a folder browser and a Use folder action. An empty
or new selected folder receives a complete base from the installed interface,
with gui/, shared logo inputs and documentation inside that folder. Existing
GUI projects are reused; unrelated nonempty folders are rejected without writes.
POST {"mode":"prepare","directory":"chosen folder"} prepares this base and
returns its GUI directory without changing the active frontend. Enabling the
dev switch prepares dependencies and activates that directory immediately.
Transitions are serialized and preserve the daemon PID, URL, active chat runs,
and PTYs. The client lifecycle watcher reloads the frontend when the active GUI
changes; chats reconnect to the existing run. Successful transitions save the
mode and source directory for future startups. customizeUI(action=normal)
restores the bundled frontend and retains the editable source files. Agents
must not stop or restart their own daemon to personalize its frontend.
Explicit server start dev <directory> and server start normal also switch
the frontend of an already-running daemon. Plain server start keeps reusing
the active daemon.
In dev mode the server uses the configured Solomon port, then starts the local Vite entrypoint through Node in the supplied GUI directory. If the local dependency is unavailable, it falls back to npm run dev -- --host 127.0.0.1 --port <free-port> while dependencies are being prepared. The Vite process stays private on its own random loopback port; the Solomon server reverse-proxies it at the stable URL advertised in runtime state, including WebSocket traffic required by hot reload. The Vite process-group leader PID is persisted so a later lifecycle command can reclaim the complete frontend tree after an interrupted or forced shutdown.
The desktop development launcher reads the running server state, verifies its health endpoint, and passes its current local URL to Wails. Both a browser and the desktop WebView therefore consume the same GUI project, the same Vite process and the same daemon APIs even if the server port changes. When the server exits it terminates the complete Vite process group, avoiding an orphaned frontend process.
The terminal panel deliberately closes only its WebSocket subscription when a
tab becomes hidden or the GUI reloads. The daemon keeps the shell or TUI process
alive, retains a bounded output buffer, and accepts a later connection with the
session id and after cursor. A daemon restart invalidates those in-memory
sessions; the client then starts a fresh session instead of retrying a dead id.
| Path | Content |
|---|---|
~/.solomon/run/server/state.json |
Runtime state used by lifecycle commands and readiness checks, including the dev-mode Vite process-group leader PID. |
~/.solomon/logs/server/server.log |
Detached server stdout and stderr. |
-
cmd/solomon/server/owns command parsing, detaching, logs, and lifecycle requests (including stale-state reclaim onstop). -
internal/server/service.goowns listening, state, health, Vite startup, proxying, and shutdown. -
internal/server/chat_api.goowns daemon chat runs, SSE replay and persisted snapshots. -
internal/server/project_api.go,customization_api.goandmodel_api.goown the non-chat GUI surfaces. -
internal/server/terminal.goandterminal_api.goown PTY sessions, output replay, resize and WebSocket attachment. -
internal/server/process_windows.go/process_unix.goown child-process teardown and server/Vite force-stop cleanup. -
scripts/desktop_dev.goreads the server state and starts Wails with its current local server URL. -
test/server_runtime_test.gostarts real local server processes with a fake Vite command to verify health, proxying, stop, and child cleanup.