Repository navigation
feat: reload configuration in chat and add a built-in /config skill - #1508
Merged
Merged
Conversation
/reload re-reads the config files and INFER_* env through the same loader startup uses and applies the keys a running chat can pick up: gateway.timeout, agent.model, agent.max_turns, agent.max_tokens and agent.reasoning_effort. Every other changed key is named in the status line as taking effect on restart and is never copied into the live config, so tools, sandbox and approval policy stay fixed for the session. A reload that fails validation or arrives while the agent is busy keeps the previous config and shows the error. The agent now reads gateway.timeout and agent.max_tokens per request instead of copying them at construction. Closes #1502
infer config set wrote any value of the right type, so a bad enum such as agent.reasoning_effort=bogus left a config.yaml that failed validation. Every later infer call failed at startup, including the config set that would fix it. The write is now checked with the same loader startup uses and the previous file is restored when it is rejected.
/config <request> maps a plain-language request onto a dotted config key, shows key: old -> new, writes it with infer config set only after the user confirms and hands /reload back to apply it to the running chat. Unknown keys get a clear answer instead of a guessed write. Tool, sandbox, MCP, channel, plugin, hook and judge policy and secrets are refused with a pointer to the file to edit by hand. Closes #1499
4 tasks
edenreich
commented
Oct 2, 2026
Hiding status bar indicators with infer config set and /reload only reported them as needing a restart, although the TUI reads chat.status_bar on every repaint. /reload now copies the whole section into the running config and reports it once as chat.status_bar instead of one entry per indicator.
Contributor
|
🎉 This PR is included in version 0.223.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Summary
/reload(closes [FEATURE] Reload configuration in chat with /reload #1502). Re-reads the config files andINFER_*env through the same loader startup uses (State.LoadConfig). Applies the keys a running chat can pick up:gateway.timeout,agent.model,agent.max_turns,agent.max_tokens,agent.reasoning_effortand the wholechat.status_barsection, which the TUI reads on every repaint.configskill (closes [FEATURE] Built-in /config skill to change settings from chat #1499)./config <request>maps the request onto a dotted key and showskey: old -> new. It writes withinfer config setonly after the user confirms, then hands/reloadback to apply the change.infer config setwrote any value of the right type. A bad enum such asagent.reasoning_effort=bogustherefore broke every laterinfercall, including theconfig setthat would repair it. The write is now checked with the startup loader and rolled back when rejected.How it works
config.ChangedKeysdiffs two configs by yaml tag. Split-file sections are named in snake_case, e.g.tools.safety.approval_behaviour.ServiceContainer.ReloadConfigcomputes two diffs:/modelor/effortchoice survives a reload that leaves those keys untouched.*config.Config, so every service keeps its pointer.agent.modelandagent.reasoning_effortgo throughSelectModelandSetReasoningEffort, so the status bar follows.gateway.timeoutandagent.max_tokensper request instead of copying them at construction.Notes
gateway.urlandgateway.api_keyare restart-only. About 12 SDK clients and the managed gateway are built from them at startup.output.*andlogging.levelfrom the issue do not exist.logging.debugstays restart-only, because re-initialising the logger would bring stdout logging back over the TUI.infer config getis deliberately not allow-listed. It would let the agent readgateway.api_keywithout approval./reloadsays it is only available ininfer chat.Test plan
go test ./..., plus-raceon container, agent loop, config, cmd/config, cmd/runtime and shortcuts.ChangedKeys.ReloadConfig: appliesgateway.timeout, keepstools.safety.approval_behaviouruntil restart, switches model and effort, and rejects an invalid config, a busy agent, and reload not being enabled.config setrollback.infer chatwith the mock gateway and a throwaway HOME:/reloadafterinfer config set gateway.timeout 300→Reloaded gateway.timeout.tools.yamlapproval change →Restart to apply tools.safety.approval_behaviour.Command failed: … invalid agent.reasoning_effort, with the old config kept.Reloaded chat.status_bar, and they disappear right away./configskill end to end against a real model.Docs
Follow-up for the docs site: inference-gateway/docs#916