From 7dbfdcf0810b4bb0d85e090d625e0ec85e88632c Mon Sep 17 00:00:00 2001 From: claude Date: Tue, 11 Aug 2026 14:06:36 +0400 Subject: [PATCH] fix(config,cli,tui): move the correx server off :8080 to :8090 (#695) mavgpud.service, the Maven GPU supervisor, is an enabled systemd user unit that binds *:8080 and restarts on kill. The correx server wanted the same port, so qa-stack died with BindException and the QA stack never came up. Worse, qa-stack's --stop ran `fuser -k 8080/tcp`, which killed mavgpud rather than a correx server; systemd then restarted it straight into the port it had just freed, so it won the race every time. Moves the default to 8090 in the four places that have to agree: ServerConfig, ConfigLoader's fallback, the CLI's DEFAULT_PORT, and the TUI's -port flag. A mismatch between any two of them is a client that cannot find its own server. The machine-local halves are not in this diff and were applied on disk: `~/.config/correx/config.toml` pinned `port = 8080` explicitly, which overrides the code default, and `scripts/` is gitignored so qa-stack.sh's five references (including the --stop kill, now aimed at 8090) live only on this box. Verified live: the server binds 8090 and answers /health while mavgpud keeps 8080. Left open in #695: mavgpud also spawns a llama-server on :10000, which is qa-stack's router port, and qa-stack pkills that pattern. Co-Authored-By: Claude Opus 5 --- apps/cli/src/main/kotlin/com/correx/apps/cli/CliConstants.kt | 2 +- apps/tui-go/main.go | 2 +- .../src/main/kotlin/com/correx/core/config/ConfigLoader.kt | 2 +- .../src/main/kotlin/com/correx/core/config/CorrexConfig.kt | 2 +- .../test/kotlin/com/correx/core/config/ConfigLoaderTest.kt | 2 +- docs/qa/ENV.md | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/cli/src/main/kotlin/com/correx/apps/cli/CliConstants.kt b/apps/cli/src/main/kotlin/com/correx/apps/cli/CliConstants.kt index edf66186..24d0aa2d 100644 --- a/apps/cli/src/main/kotlin/com/correx/apps/cli/CliConstants.kt +++ b/apps/cli/src/main/kotlin/com/correx/apps/cli/CliConstants.kt @@ -1,3 +1,3 @@ package com.correx.apps.cli -internal const val DEFAULT_PORT = 8080 +internal const val DEFAULT_PORT = 8090 diff --git a/apps/tui-go/main.go b/apps/tui-go/main.go index cf18bddc..8968d2e5 100644 --- a/apps/tui-go/main.go +++ b/apps/tui-go/main.go @@ -15,7 +15,7 @@ import ( func main() { host := flag.String("host", "localhost", "server host") - port := flag.Int("port", 8080, "server port") + port := flag.Int("port", 8090, "server port") flag.Parse() if path := os.Getenv("CORREX_TUI_LOG"); path != "" { diff --git a/core/config/src/main/kotlin/com/correx/core/config/ConfigLoader.kt b/core/config/src/main/kotlin/com/correx/core/config/ConfigLoader.kt index 2003df82..3c9cfbca 100644 --- a/core/config/src/main/kotlin/com/correx/core/config/ConfigLoader.kt +++ b/core/config/src/main/kotlin/com/correx/core/config/ConfigLoader.kt @@ -184,7 +184,7 @@ object ProfileLoader { } object ConfigLoader { - private const val DEFAULT_SERVER_PORT = 8080 + private const val DEFAULT_SERVER_PORT = 8090 private const val DEFAULT_SESSION_LIST_LIMIT = 5 private const val DEFAULT_EMBEDDER_DIMENSION = 1536 private const val DEFAULT_L3_DIM = 1536 diff --git a/core/config/src/main/kotlin/com/correx/core/config/CorrexConfig.kt b/core/config/src/main/kotlin/com/correx/core/config/CorrexConfig.kt index 9aaed1a7..6f39e62f 100644 --- a/core/config/src/main/kotlin/com/correx/core/config/CorrexConfig.kt +++ b/core/config/src/main/kotlin/com/correx/core/config/CorrexConfig.kt @@ -184,7 +184,7 @@ data class ArtifactKindConfig( @Serializable data class ServerConfig( val host: String = "localhost", - val port: Int = 8080, + val port: Int = 8090, ) @Serializable diff --git a/core/config/src/test/kotlin/com/correx/core/config/ConfigLoaderTest.kt b/core/config/src/test/kotlin/com/correx/core/config/ConfigLoaderTest.kt index 323456f5..f237cbf2 100644 --- a/core/config/src/test/kotlin/com/correx/core/config/ConfigLoaderTest.kt +++ b/core/config/src/test/kotlin/com/correx/core/config/ConfigLoaderTest.kt @@ -9,7 +9,7 @@ class ConfigLoaderTest { fun `load returns defaults when config file missing`() { val config = CorrexConfig() assertEquals("localhost", config.server.host) - assertEquals(8080, config.server.port) + assertEquals(8090, config.server.port) assertEquals("dark", config.tui.theme) assertEquals(5, config.tui.sessionListLimit) assertEquals("human", config.cli.defaultOutput) diff --git a/docs/qa/ENV.md b/docs/qa/ENV.md index eb87b882..9cab4432 100644 --- a/docs/qa/ENV.md +++ b/docs/qa/ENV.md @@ -76,7 +76,7 @@ scripts/qa/searxng-down.sh ## 4. Start the server ```bash -./gradlew :apps:server:run # mainClass com.correx.apps.server.MainKt, listens on :8080 +./gradlew :apps:server:run # mainClass com.correx.apps.server.MainKt, listens on :8090 # or build a runnable dist once and reuse it: ./gradlew :apps:server:installDist apps/server/build/install/server/bin/server @@ -90,7 +90,7 @@ apps/server/build/install/server/bin/server ```bash cd apps/tui-go GOTOOLCHAIN=auto go build -o correx-tui . -./correx-tui -host localhost -port 8080 # flags default to localhost:8080 +./correx-tui -host localhost -port 8090 # flags default to localhost:8090 ``` ## 6. Evidence tools (what the plans cite)