Skip to content

fix(gateway): hot-reload agents.defaults.models allowlist changes#33606

Closed
hclsys wants to merge 1 commit intoopenclaw:mainfrom
hclsys:fix/hot-reload-models-allowlist
Closed

fix(gateway): hot-reload agents.defaults.models allowlist changes#33606
hclsys wants to merge 1 commit intoopenclaw:mainfrom
hclsys:fix/hot-reload-models-allowlist

Conversation

@hclsys
Copy link
Copy Markdown
Contributor

@hclsys hclsys commented Mar 3, 2026

Summary

agents.defaults.models (plural — the allowlist array) had no reload rule. Changes to the model allowlist in openclaw.json were silently ignored at runtime because the path fell through to the catch-all agents tail rule (kind=none).

The existing rule for agents.defaults.model (singular) does not prefix-match agents.defaults.models — the next character is s, not ..

Changes

  • Add agents.defaults.models reload rule with restart-heartbeat action
  • Add test verifying allowlist changes trigger heartbeat restart (not no-op)

Test plan

  • pnpm vitest run src/gateway/config-reload.test.ts — 22/22 pass
  • Existing agents.defaults.model (singular) test still passes
  • New test confirms agents.defaults.modelsrestartHeartbeat=true, not noopPaths

Fixes #33600

lobster-biscuit

The reload plan had a rule for `agents.defaults.model` (singular) but
not `agents.defaults.models` (plural — the allowlist array).  Because
`agents.defaults.models` does not prefix-match `agents.defaults.model.`,
it fell through to the catch-all `agents` tail rule (kind=none), so
allowlist edits in openclaw.json were silently ignored at runtime.

Add a dedicated reload rule so changes to the models allowlist trigger
a heartbeat restart, which re-reads the config and serves the updated
list to clients.

Fixes openclaw#33600

Co-authored-by: HCL <[email protected]>
Signed-off-by: HCL <[email protected]>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 3, 2026

Greptile Summary

This PR fixes a silent no-op bug in the gateway config hot-reload system: changes to agents.defaults.models (the model allowlist array) were never triggering a heartbeat restart because no explicit rule existed for that path, causing it to fall through to the agents catch-all no-op rule in BASE_RELOAD_RULES_TAIL.

The fix adds a dedicated agents.defaults.models reload rule with restart-heartbeat action, inserted before the existing agents.defaults.model (singular) rule. The rule ordering is safe — neither rule can shadow the other because the prefix-match condition requires either an exact match or a .-delimited child path, and "agents.defaults.models" does not start with "agents.defaults.model.".

Key changes:

  • Added agents.defaults.models hot-reload rule in BASE_RELOAD_RULES (config-reload-plan.ts)
  • Added a focused regression test confirming the path sets restartHeartbeat=true and is absent from noopPaths (config-reload.test.ts)
  • All 22 existing tests continue to pass

Confidence Score: 5/5

  • Safe to merge — minimal, targeted bug fix with no risk of regressions.
  • This PR is a single rule insertion in an ordered list. The prefix-matching logic ensures no shadowing between the new agents.defaults.models rule and the existing agents.defaults.model rule. The new test directly validates the previously broken behavior, and all existing tests pass. Code changes are minimal and focused on fixing the identified issue.
  • No files require special attention

Last reviewed commit: a615f0c

@Takhoffman
Copy link
Copy Markdown
Contributor

Thanks again for this work.

This was landed indirectly via the synthesized PR #33831, and your contribution is credited in the changelog and as a co-author on the merge commit.

This PR merge/triage workflow is AI-assisted.

Closing this PR as superseded by #33831. If anything here looks incorrect or incomplete, reply to reopen and we can reassess.

@Takhoffman Takhoffman closed this Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: agents.defaults.models allowlist changes not applied on hot-reload

2 participants