Skip to content

fix(delegate): read delegation config from disk first to avoid stale cache#18967

Closed
Thatgfsj wants to merge 1 commit into
NousResearch:mainfrom
Thatgfsj:fix/delegate-load-config-stale-cache
Closed

fix(delegate): read delegation config from disk first to avoid stale cache#18967
Thatgfsj wants to merge 1 commit into
NousResearch:mainfrom
Thatgfsj:fix/delegate-load-config-stale-cache

Conversation

@Thatgfsj

@Thatgfsj Thatgfsj commented May 2, 2026

Copy link
Copy Markdown

Summary

Fixes #18946

_load_config() in tools/delegate_tool.py checked the runtime cache (cli.CLI_CONFIG) first and never fell back to disk when the cache existed. This meant hermes config set delegation.model <X> wrote to disk correctly but the running process continued using the old value silently.

Changes

Reverse the priority in _load_config(): always read from the persistent config file first, falling back to CLI_CONFIG only when the disk read fails. This makes delegation.* changes take effect immediately without requiring a process restart.

Test plan

# Start hermes, then from another shell:
hermes config set delegation.model some-other-model
# delegate_task should now use the new model without restart

…cache

_load_config() checked the runtime cache (cli.CLI_CONFIG) first and
never fell back to disk when the cache existed. This meant `hermes
config set delegation.model <X>` wrote to disk correctly but the
running process continued using the old value.

Reverse the priority: always read from the persistent config file
first, falling back to CLI_CONFIG only when the disk read fails.
This makes delegation.* changes take effect immediately without
requiring a process restart.

Fixes NousResearch#18946
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists tool/delegate Subagent delegation area/config Config system, migrations, profiles labels May 2, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #18947 — same root cause: _load_config() in delegate_tool.py reads stale CLI_CONFIG cache instead of disk. Also see earlier PRs #15540, #8004.

@alt-glitch alt-glitch added the duplicate This issue or pull request already exists label May 2, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #18947 — same root cause: _load_config() in delegate_tool.py reads stale CLI_CONFIG cache instead of disk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists tool/delegate Subagent delegation type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: hermes config set delegation.* silently has no effect on running process (CLI_CONFIG cache stale)

2 participants