Repository navigation
fix: the launcher follows the config the gateway applied - #34
Merged
Merged
Conversation
mekjr1
force-pushed
the
fix/gateway-applied-config
branch
2 times, most recently
from
October 7, 2026 19:51
8fd6da2 to
d4ccf7e
Compare
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
force-pushed
the
fix/gateway-applied-config
branch
from
October 7, 2026 20:15
ef0e9cd to
5bbef7f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, throughgateway.hot_reloador/reloadin a chat, applies everything the signature covers, yet the indicator stayed until a restart.Now the gateway says which config it applied:
pkg/config(RestartSignature,NewRestartSignature,ModelSelections), unchanged, so the kernel can compute it.RestartSignature.Digestidentifies a signature without showing any setting./ready(config_digest), at start and after each successful reload. Because the gateway computes it from its own loaded config, it covers whatLoadConfigadds outside the files: the environment's overrides andfile://credentials./readyprobe 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 byapplyLiveConfigtoo): 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.portandgateway.hot_reloadas they were; the signature doesn't cover them. A gateway that reports no digest keeps the old behaviour.Docs:
docs/troubleshooting.mdsays the indicator lasts until the gateway restarts or reloads. CHANGELOG line.Tests:
TestRestartSignatureDigest,TestReadyHandler_ReportsTheAppliedConfig, andTestGatewayStatusFollowsTheConfigTheGatewayApplied. 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.