docs(serve): say that serve runs the Telegram and Discord channels - #396
Open
plombeer31 wants to merge 2 commits into
Open
docs(serve): say that serve runs the Telegram and Discord channels#396plombeer31 wants to merge 2 commits into
plombeer31 wants to merge 2 commits into
Conversation
Two things checked against the code rather than against the prose. `SwarmRegistry.startEnabled()` filters on `enabled && token !== null`, so an enabled swarm unit with no token is silently skipped. "every enabled swarm bot" promised more than serve delivers; it now says "that has a token", in the README and in `serve --help`. `atomic-agent --help` still described serve as an HTTP API only. That top-level line is the one people read before they ever run `serve --help`, so leaving it stale keeps the discovery gap this change set out to close. Reworded to name the channels. Also reflows the help paragraph so no line trails a two-word orphan.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Someone asked this in Discord and nobody answered it (
adithr, 2026-09-08):There is:
atomic-agent serve. It is just undiscoverable — nothing user-facing says so. This PR is documentation only; no behaviour changes.What the code actually does
serveCommand(src/cli/serve-command.ts) callscreateAgentRuntimewithworkingDir/approvalLevel/traceDefault/handlersonly. There is no option that suppresses channels, and none exists inAgentRuntimeOptions.createAgentRuntime(src/runtime/bootstrap.ts) constructsTelegramChannelandDiscordChannelunconditionally and firesstart()whenconfig.telegram.enabled/config.discord.enabled. TheSwarmRegistryis built in the same block andstartEnabled()starts every unit whose config isenabledand whose token env var resolves (src/channels/swarm/swarm-registry.ts). So a plainatomic-agent servekeeps Telegram, Discord and the swarm bots live with no TUI attached.serve --helptext advertised the command purely as "start the OpenAI-compatible HTTP API" and never mentioned channels — that is the discoverability gap this fixes.The lock
TelegramLockfile/DiscordLockfile(src/channels/telegram/telegram-lockfile.ts,src/channels/discord/discord-lockfile.ts) write the PID withflag: "wx". OnEEXISTthey read the holder's PID and, if it is a different live process (process.kill(pid, 0)), throwformatChannelLockHeld(pid); a stale lock whose PID is gone is reclaimed transparently.So: the first process to start a channel wins. In the loser,
DiscordChannel.start()catches the throw and callsfail(...), andTelegramChannel.start()catches it and transitions todown— in both cases the channel settles atdownwith reasonchannel-locked: already running in another atomic-agent (pid N)and never retries; it only tries again if something callsstart()again (config toggle, restart). The Integrations pane renders that reason asconfigured, noterror(src/integrations/telegram-integration.ts,src/integrations/discord-integration.ts), because the bot is up — just served from the other process.What changed
HELPinsrc/cli/serve-command.ts: aRemote channels:block in the same terse aligned style, stating that enabled Telegram/Discord/swarm bots run in this process, that nothing restarts the process for you, and what the single-instance lock means alongside a TUI.README.md: one paragraph in the OpenAI-compatible HTTP block and one in the Telegram remote control block, cross-referencing the same fact.What I checked and did NOT change
README.mdand every top-level*.mdforserve/headless/daemon/telegram/discord. The only existing statement of this fact is inAGENTS.md(contributor doc, Telegram section) — nothing user-facing.nohup/systemd/launchdrecipe (the README does not talk about long-running processes that way).npm run lintpasses;npx vitest run src/cliis 17 files / 182 tests green (no test asserts on the serve help text).