Skip to content

fix: cache persona on startup + reloadPersona() hook#76

Merged
royosherove merged 1 commit intomainfrom
fix/persona-cache-on-start
May 9, 2026
Merged

fix: cache persona on startup + reloadPersona() hook#76
royosherove merged 1 commit intomainfrom
fix/persona-cache-on-start

Conversation

@royosherove
Copy link
Copy Markdown
Member

Persona files loaded once at gateway start, cached for process lifetime.
reloadPersona() exported for future agent file-write hook integration.
393 tests green.

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.
@royosherove royosherove merged commit 1813843 into main May 9, 2026
1 check passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +68 to +69
if (cachedPersona === null) loadPersona();
if (!cachedPersona) return text;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant