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.
Addresses final gateway keystore gap:
- move keystore injection outside the config.yaml existence branch so
gateway/headless installs with only a keystore (and a stubbed .env)
still receive credentials on import/startup
- re-run keystore injection in the long-lived gateway credential refresh
path so rotated keystore secrets can take effect without restart
- fix keystore store methods to use short-lived sqlite connections instead
of a persistent connection, avoiding database-locked failures during
injectable secret reads from fresh processes
- add gateway regression tests for startup without config.yaml and refresh-
path reinjection of keystore-backed secrets
Validation: targeted suite now 136 passing
Addresses review findings:
- Remove insecure automatic encrypted-file credential-store fallback.
now only uses real OS/keyctl-backed stores,
or remains unavailable. Headless users must use explicit
HERMES_KEYSTORE_PASSPHRASE if desired.
- Add shared wallet runtime so tools/CLI/approval use the same configured
providers and persisted policy state.
- Inject keystore-backed secrets into gateway/headless startup too, so
migrated .env stubs don't break messaging deployments.
- Persist wallet policy state (freeze, daily totals, rate-limit timestamps,
cooldown timestamps) across invocations.
- Persist transaction history to disk across invocations.
- Make owner-approved sends execute through the same runtime/policy path and
record policy state after successful approved sends.
- Fix wallet export by allowing explicit CLI export reads of sealed keys via
dedicated requester path () instead of generic CLI reads.
- Make CLI wallet sends evaluate policy before execution and honor freeze.
- Align docs with actual crypto primitive (XSalsa20-Poly1305 via SecretBox)
and current policy-config scope.
Validation:
- 129 tests passing
- freeze persistence verified manually
- wallet export verified manually