fix: reread config on in-process gateway restart#80161
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. Current main's source path shows the stale pre-read snapshot is passed into every in-process restart start, and the linked bug plus PR proof describe a concrete SIGUSR1/config-write path; I did not run an independent live container repro in this read-only pass. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land one narrow consume-once startup snapshot fix with the regression test, then close the linked bug after merge and close the duplicate fix PR as superseded. Do we have a high-confidence way to reproduce the issue? Yes. Current main's source path shows the stale pre-read snapshot is passed into every in-process restart start, and the linked bug plus PR proof describe a concrete SIGUSR1/config-write path; I did not run an independent live container repro in this read-only pass. Is this the best way to solve the issue? Yes. Consuming the CLI pre-read snapshot once is the narrow owner-boundary fix: first boot keeps the startup optimization, later in-process restarts omit What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 35ceba0e4e6a. |
4ad1ac9 to
fcc6ebc
Compare
* fix: reread config on in-process gateway restart * fix: refresh swift protocol model
* fix: reread config on in-process gateway restart * fix: refresh swift protocol model
* fix: reread config on in-process gateway restart * fix: refresh swift protocol model
* fix: reread config on in-process gateway restart * fix: refresh swift protocol model
* fix: reread config on in-process gateway restart * fix: refresh swift protocol model (cherry picked from commit 537bcad)
* fix: reread config on in-process gateway restart * fix: refresh swift protocol model
* fix: reread config on in-process gateway restart * fix: refresh swift protocol model
* fix: reread config on in-process gateway restart * fix: refresh swift protocol model (cherry picked from commit 537bcad)
* fix: reread config on in-process gateway restart * fix: refresh swift protocol model
* fix: reread config on in-process gateway restart * fix: refresh swift protocol model (cherry picked from commit 537bcad)
* fix: reread config on in-process gateway restart * fix: refresh swift protocol model
* fix: reread config on in-process gateway restart * fix: refresh swift protocol model (cherry picked from commit 537bcad)
Summary
startupConfigSnapshotReadpre-read only for the firstgateway runstart inside the in-process restart loop.Real behavior proof
gateway runrestarts must not reuse the first startup config snapshot after the config file changes on disk.OPENCLAW_HOME/OPENCLAW_STATE_DIR/OPENCLAW_CONFIG_PATH, real gateway process on127.0.0.1:19661.pnpm --silent openclaw gateway run --port 19661withOPENCLAW_NO_RESPAWN=1, temp config tokentoken-before, verifiedgateway health, rewrote the temp config token totoken-after, sentSIGUSR1, then verifiedgateway healthwithtoken-after.token-afterconfig after SIGUSR1, showing the second in-process start reread disk config instead of reusing the first startup snapshot.Verification
OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=/tmp/openclaw-vitest-cache-79947 pnpm test src/cli/gateway-cli/run.option-collisions.test.tspnpm check:changedpnpm exec oxfmt --check --threads=1 src/cli/gateway-cli/run.ts src/cli/gateway-cli/run.option-collisions.test.ts CHANGELOG.mdgit diff --check