Skip to content

fix: reconcile the agent's persona during the deploy (#16) - #19

Closed
EthanThatOneKid wants to merge 1 commit into
mainfrom
fix/sync-persona-on-deploy
Closed

EthanThatOneKid wants to merge 1 commit into
mainfrom
fix/sync-persona-on-deploy

Conversation

@EthanThatOneKid

Copy link
Copy Markdown
Contributor

Closes #16.

The gap

agent/instructions.md is Data's prompt, but the agent answers from the copy its memory holds at system/persona.md, and only npm run sync-persona reconciles the two. Nothing ran it:

  • .github/workflows/deploy.yml did not watch agent/**, so a prompt-only merge triggered no deploy at all.
  • scripts/zo-deploy.ts fast-forwarded the live checkout and restarted each service, but never touched the persona.

After #7 merged (eb59a21) the live agent was still answering from the pre-cutover text; it only caught up when the sync was run by hand (memory checkout 0a2928a).

The change

  • deploy.yml watches agent/** and the data-http step passes --run "npm run sync-persona".
  • scripts/zo-deploy.ts gains --run <command>: a command executed on the host in the deployed checkout, after the fast-forward and before the restart. A non-zero exit aborts the deploy with the running service untouched — the same guarantee the fast-forward already had. The dry run does not execute it.

Sequencing is the point: the sync has to run after the fast-forward that brings the new agent/instructions.md onto the host, and before the services restart.

Verification

  • npm run typecheck clean; npm test 29/29, including three new cases against the fake Zo MCP endpoint: the run happens after the fast-forward and before the restart, a failing run leaves the service untouched, and a dry run does not run it.
  • The exact host command the deploy will run was executed on the Zo host: cd <checkout> && npm run sync-persona → system/persona.md already matches agent/instructions.md. It is idempotent, so a deploy with nothing to reconcile is a no-op.
  • deploy.yml parses, and its path list is now agent/**, channels/http/**, channels/discord/**, lib/**, scripts/**, package.json, package-lock.json, .github/workflows/deploy.yml.

Not in this PR

The retry for rate-limited turns is #18. A prompt-only merge still restarts data-http; harmless, since the service spawns a fresh letta child per turn and reads the memory at that point.

agent/instructions.md is Data's prompt, but the agent answers from the copy its
memory holds at system/persona.md, and only `npm run sync-persona` reconciles
the two. Nothing ran it: the deploy path filter did not watch agent/**, and the
deploy script fast-forwarded and restarted without touching the persona. After
#7 merged, the live agent was still answering from the pre-cutover text until
the sync was run by hand.

Watch agent/** and give the deploy script a --run flag that executes a command
in the deployed checkout after the fast-forward and before the restart, so the
data-http step runs npm run sync-persona on the host. A failing --run aborts
with the service untouched.

Closes #16.
@wazoocomputer

wazoocomputer Bot commented Sep 26, 2026

Copy link
Copy Markdown

This pull request addresses issue #16 by ensuring that the agent's persona is correctly synchronized during deployment. Previously, changes to agent/instructions.md were not always reflected in the live agent because the deployment workflow did not watch the agent/** path and did not run the npm run sync-persona command. This PR modifies the deploy.yml workflow to watch agent/** and introduces a new --run flag to scripts/zo-deploy.ts to execute npm run sync-persona after the fast-forward and before the service restart, guaranteeing that the agent’s persona is up-to-date.

File Path Change Type Summary
.github/workflows/deploy.yml modified Update workflow to watch agent directory and sync persona
AGENTS.md modified Clarify persona synchronization process
lib/zo-deploy-cli.test.ts modified Add tests for the new --run flag in zo-deploy-cli
scripts/zo-deploy.ts modified Implement --run flag for executing commands post-deploy

Reviewers should start by examining .github/workflows/deploy.yml to understand the trigger and the new --run command integration.

@wazoocomputer

wazoocomputer Bot commented Sep 26, 2026

Copy link
Copy Markdown

This pull request addresses issue #16 by ensuring that the agent's persona is correctly synchronized during deployment. Previously, changes to agent/instructions.md were not always reflected in the live agent because the deployment workflow did not watch the agent/** path and did not run the npm run sync-persona command. This PR modifies the deploy.yml workflow to watch agent/** and introduces a new --run flag to scripts/zo-deploy.ts to execute npm run sync-persona after the fast-forward and before the service restart, guaranteeing that the agent’s persona is up-to-date.

File Path Change Type Summary
.github/workflows/deploy.yml modified Update workflow to watch agent directory and sync persona
AGENTS.md modified Clarify persona synchronization process
lib/zo-deploy-cli.test.ts modified Add tests for the new --run flag in zo-deploy-cli
scripts/zo-deploy.ts modified Implement --run flag for executing commands post-deploy

Reviewers should start by examining .github/workflows/deploy.yml to understand the trigger and the new --run command integration.

@EthanThatOneKid

Copy link
Copy Markdown
Contributor Author

Superseded by #22. The persona this reconciled was a copy inside a self-hosted Letta agent's memory, and that runtime is retired — there is no second copy of Data's prompt left to drift. The deploy this edits is also simplified in #22 (one service instead of two). Closing.

@EthanThatOneKid
EthanThatOneKid deleted the fix/sync-persona-on-deploy branch September 26, 2026 07:11
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.

deploy: a change to agent/instructions.md never reaches the live agent

1 participant