fix: cache persona on startup + reloadPersona() hook#76
Conversation
Persona is loaded once at gateway start and cached for the process lifetime. reloadPersona() exported for agent to call after editing user.md/soul.md. Avoids repeated disk reads on every turn.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b970d12e7a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (cachedPersona === null) loadPersona(); | ||
| if (!cachedPersona) return text; |
There was a problem hiding this comment.
Wire persona reload when persona files change
Caching soul.md/user.md for process lifetime introduces a behavior regression: updates to those files are no longer reflected in subsequent turns unless reloadPersona() is called, but there is no call site for reloadPersona() (gateway startup only calls loadPersona() in src/gateway/gateway.ts). In workflows where the agent or user edits these files during runtime, prompts keep using stale persona content until a restart, which breaks dynamic persona updates that previously worked turn-by-turn.
Useful? React with 👍 / 👎.
Persona files loaded once at gateway start, cached for process lifetime.
reloadPersona()exported for future agent file-write hook integration.393 tests green.