anomalyco / anomalyco/opencode
tui: client polls http://localhost:8000/health every 30s from any project
@kommander is already working on this.
Since Aug 26, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- Avg merge
- 7h 2m
- Merged PRs (30d)
- 384
Description
Summary
While any OpenCode TUI client is running, something inside the client sends
GET http://localhost:8000/health every 30 seconds to whatever service happens
to be listening on port 8000 on localhost — regardless of working directory or
project. The polling continues indefinitely even though the endpoint returns 404,
is not visible in opencode logs, and cannot be traced to any config, plugin, or
MCP server.
Environment
- opencode version: 0.0.0-beta-18269
- OS: Darwin 27.0.0 (macOS, arm64)
- Terminal: tmux (TERM=xterm-256color, COLORTERM=truecolor)
- Shell: /bin/zsh
- Install/channel: beta (
~/.local/lib/node_modules/@opencode-ai/cli) - Active plugins: none configured; only MCP server is chrome-devtools (local npx)
Reproduction
- Start any local HTTP server on port 8000 that logs requests (in my case a
FastAPI/uvicorn app) with a middleware that logs path + User-Agent. - Start the background service only (
opencode2 serve --serviceequivalent):
no polling occurs. - Kill all opencode processes: polling stops immediately.
- Start
opencode2(TUI/client): polling begins within seconds.
Observed server-side log:
11:55:19 /health from 127.0.0.1:58849 UA='opencode2/0.0.0-beta-18269'
INFO: 127.0.0.1:58849 - "GET /health HTTP/1.1" 404 Not Found
11:55:49 /health from 127.0.0.1:58885 UA='opencode2/0.0.0-beta-18269'
INFO: 127.0.0.1:58885 - "GET /health HTTP/1.1" 404 Not Found
Requests arrive exactly ~30s apart, indefinitely, from any directory (tested in
the project dir and in an unrelated neutral directory).
Additional observations:
lsof -i :8000shows the socket owned by theserve --serviceprocess
(i.e., an in-process HTTP client of the server, not a spawned shell/curl).- Nothing appears in
~/.local/share/opencode/log/opencode.logwhen the
requests fire. - No config file, plugin, MCP config, skill, agent definition, or env var on
the machine references port 8000 or/health. - On one occasion uvicorn reported
request.client is Nonefor this request,
which normally doesn't happen for plain TCP connections. - The polled endpoint returns 404 and polling does not back off or stop.
Expected Behavior
If this is intentional dev-server detection/probing, it should be:
- documented and logged,
- stopped or backed off after repeated non-2xx responses,
- restricted to relevant ports/projects, and ideally configurable/disable-able.
If it's not intentional, the client should not send unsolicited requests to
arbitrary local services.
Actual Behavior
Undocumented, unlogged, unstoppable 30s polling of localhost:8000/health
whenever a TUI client is connected, hitting unrelated local services.
Additional Context
Isolation experiments performed:
| State | Polling? |
|---|---|
| Background service only | No |
| All opencode processes killed | No |
| Service + TUI client | Yes (~30s interval) |
| Client started in unrelated directory | Yes |
Happy to run further diagnostics on request.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.