After TOML loading and generic env overrides, config.Load now checks
$PORT and $PORT_GRPC and overrides ServerConfig.ListenAddr and
ServerConfig.GRPCAddr respectively. These take precedence over all
other config sources because they represent agent-assigned authoritative
port bindings.
Handles both Base embedding (MCR, MCNS, MCAT) and direct ServerConfig
embedding (Metacrypt) via struct tree walking.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
kyle
merged commit cef06bdf63 into master2026-03-27 08:13:59 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary\n\n- Add
$PORTand$PORT_GRPCenvironment variable support toconfig.Load\n- After TOML and generic env overrides, checks$PORT→ overridesServer.ListenAddr,$PORT_GRPC→ overridesServer.GRPCAddr\n- Takes precedence over all other config sources (agent-assigned authoritative binding)\n- Handles bothconfig.Baseembedding (MCR, MCNS, MCAT) and directServerConfigembedding (Metacrypt) via struct tree walking\n\n## Test plan\n\n- [x]TestPortEnvOverridesListenAddr— $PORT sets listen addr\n- [x]TestPortGRPCEnvOverridesGRPCAddr— $PORT_GRPC sets gRPC addr\n- [x]TestPortEnvOverridesTOMLValue— $PORT wins over TOML\n- [x]TestPortEnvOverridesGenericEnv— $PORT wins over generic env overrides\n- [x]TestNoPortEnvNoChange— no $PORT leaves values unchanged\n- [x]TestPortEnvDirectServerConfig— works with Metacrypt-style embedding\n- [x] All 20 config tests pass