pub const DEFAULT_HTTP_PORT: u16 = 7882;Expand description
Default TCP port for tcode serve --http when --port is omitted.
Why: the trusty-* family reserves a block of fixed local ports so
operators/tooling can find a daemon without a discovery file
(trusty-search 7878,
trusty-mpm daemon 7880, trusty-embedderd --http mode 7890).
trusty-review used to hold 7891 and no longer does — #6277 moved it to a
Unix socket. This constant previously reused 7881, which turned
out to collide with trusty-mpm’s supervisor metrics listener — the two
defaults were picked independently and nothing pinned them apart, so a
fresh install with both tm supervisor and tcode serve running answered
/health on tcode’s port with the supervisor’s generic
{"status":"ok"}, masking a real 404 for every other route (#3364). That
listener is retired (#6288 — the supervisor publishes to a file), so 7881
is free again; this constant stays on 7882 because a released value is
not reused. 7882 is verified free against
the full known-sibling table in
docs/architecture/port-assignments.md and matches the session-local
workaround used to confirm the fix (tcode serve --http --port 7882).
Pass --port 0 to bind an OS-assigned ephemeral port instead (e.g. for
tests or running multiple instances side by side); the real bound port
is always logged to stderr regardless of which is used.
What: 7882.
Test: default_http_port_is_documented_value,
default_http_port_does_not_collide_with_known_siblings.