Skip to content

fix: the launcher follows the config the gateway applied - #34

Merged
mekjr1 merged 5 commits into
mainfrom
fix/gateway-applied-config
Oct 7, 2026
Merged

mekjr1 merged 5 commits into
mainfrom
fix/gateway-applied-config

Conversation

@mekjr1

@mekjr1 mekjr1 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #4.

Gateway restart required compares the saved config's restart signature with the one the launcher believes the gateway applied (gateway.bootConfig). The launcher updated that belief only after a reload it asked for itself (applyLiveConfig). A gateway that reloaded on its own, through gateway.hot_reload or /reload in a chat, applies everything the signature covers, yet the indicator stayed until a restart.

Now the gateway says which config it applied:

  • The restart signature moves from the launcher to pkg/config (RestartSignature, NewRestartSignature, ModelSelections), unchanged, so the kernel can compute it. RestartSignature.Digest identifies a signature without showing any setting.
  • The gateway reports the digest of the signature of the config it applied on /ready (config_digest), at start and after each successful reload. Because the gateway computes it from its own loaded config, it covers what LoadConfig adds outside the files: the environment's overrides and file:// credentials.
  • The launcher reads it from the /ready probe its status already makes. While the gateway reports one, the indicator is whether that is the saved config's, except while a reload the launcher asked for is pending, when the old comparison (live parts left out) still applies. A match also records the saved config as applied (recordAppliedConfigLocked, used by applyLiveConfig too): default model, signature, and the web chat token taken from that config, not re-read from disk. So the indicator also follows a gateway the launcher attached to, and one whose reload failed.

A reload leaves gateway.host, gateway.port and gateway.hot_reload as they were; the signature doesn't cover them. A gateway that reports no digest keeps the old behaviour.

Docs: docs/troubleshooting.md says the indicator lasts until the gateway restarts or reloads. CHANGELOG line.

Tests: TestRestartSignatureDigest, TestReadyHandler_ReportsTheAppliedConfig, and TestGatewayStatusFollowsTheConfigTheGatewayApplied. The last covers before a reload, after it, and a gateway that runs another config than the launcher took it for; it fails without the change.

@mekjr1
mekjr1 force-pushed the fix/gateway-applied-config branch 2 times, most recently from 8fd6da2 to d4ccf7e Compare October 7, 2026 19:51
mekjr1 added 5 commits October 7, 2026 14:13
Gateway restart required compared the saved config with the config the launcher believed the gateway ran, which it updated only after reloads it asked for itself. A gateway that reloaded on its own, through hot reload or /reload in a chat, kept the indicator on until it restarted. LoadConfig now records a digest of the config.json and .security.yml it read; the gateway reports the digest of the config it applied on /ready, at start and after each reload; and the launcher, when that digest is the saved config's, takes the saved config as the one the gateway runs.
…lows it

Reviews of the first version showed a digest of the config files misses what LoadConfig adds outside them, the environment's overrides and file:// credentials, so it could clear the indicator for a gateway that runs other settings. The restart signature moves from the launcher to pkg/config (RestartSignature, ModelSelections); the gateway reports the digest of the signature of the config it applied, and while it does, the indicator is whether that is the saved config's, except while a reload the launcher asked for is pending. A match records the saved config as applied, its web chat token taken from that config. The file digest is gone.
… it; an empty signature has no digest

After its own reload, the launcher recorded the config it had read, though the gateway reloads the files as they are and may apply a newer save; it now checks the digest the gateway reports. RestartSignature.Digest is empty for any empty signature, as Equal treats nil and empty alike. The status test also checks what adoption records.
@mekjr1
mekjr1 force-pushed the fix/gateway-applied-config branch from ef0e9cd to 5bbef7f Compare October 7, 2026 20:15
@mekjr1
mekjr1 merged commit 5106938 into main Oct 7, 2026
12 checks passed
@mekjr1
mekjr1 deleted the fix/gateway-applied-config branch October 7, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Gateway restart required" stays after Compa reloads its config by itself

1 participant