Force-refresh now also clears env vars that were previously injected by the
keystore but no longer exist in the current injectable secret set. This lets
credential deletion/revocation propagate in long-lived gateway processes
without restart, while still preserving external env precedence.
Adds a regression test covering deletion of a keystore-backed OPENAI_API_KEY
followed by gateway refresh.
Refines force-refresh semantics so rotated keystore secrets only overwrite
variables that were previously injected by the keystore. Externally supplied
env vars (shell/Docker/systemd) remain authoritative across the life of the
process, matching startup precedence.
Also adds a mixed-precedence regression test covering the case where an
external OPENAI_API_KEY is present alongside an initialized keystore.
The gateway refresh path now calls keystore injection with force=True so
rotated secrets replace stale in-process env vars without requiring a
restart. Startup paths still keep the default non-overwriting behavior so
shell exports and explicitly supplied env vars win on boot.
Also tighten the regression test to require the rotated keystore secret to
replace a stale env value during refresh, instead of accepting either old
or new values.