fix: persona is source of truth at spawn + thread-depth conventions#930
Merged
Conversation
Tighten the base prompt's threading guidance so agents keep threads shallow (reply to the thread root, not the latest message) and surface milestones at the channel root. Folds the existing "broadcast on completion" bullet into the new "report milestones at the root" bullet to avoid restating the same idea. Proposed convention for team discussion — not a unilateral default change. Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
…ents Persona edits never reached agents created from a plain persona (not an installed pack): spawn only consulted the live PersonaRecord when both persona_pack_path and persona_name_in_pack were set, so non-pack agents fell through to the frozen record.system_prompt snapshot. Editing the persona left that snapshot stale, and no restart could pick it up. Resolve the linked persona whenever persona_id is set (pack or not); the persona is the source of truth and edits propagate on the next spawn. Fall back to the record snapshot only when no persona is linked or it was deleted. Pack agents are unaffected (they already set persona_id). Extract the resolution into a pure helper and move the runtime test module to runtime/tests.rs (env_vars/tests.rs pattern), keeping runtime.rs under the file-size limit. 4 new unit tests cover persona-wins, no-persona fallback, deleted-persona fallback, and persona-clears-stale-model. Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co> Signed-off-by: Wes <wesbillman@users.noreply.github.com>
f572373 to
3ba2072
Compare
wpfleger96
approved these changes
Jun 9, 2026
Pack edits on disk were not propagating to persona records until the user manually uninstalled and reimported. This left the spawn-time persona resolution (fixed in this branch) reading stale data for pack agents. On startup, iterate persona records with source_pack set, resolve the corresponding pack directory, and update system_prompt, model, avatar_url, and display_name if they differ from the resolved pack content. Signed-off-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
eb15be0 to
48698b2
Compare
tlongwell-block
pushed a commit
that referenced
this pull request
Jun 10, 2026
* origin/main: Fix post-compact handoff context for OpenAI providers (#931) chore(release): release version 0.3.15 (#936) fix: persona is source of truth at spawn + thread-depth conventions (#930) fix: skip avatar reconciliation for legacy agent records (#933) feat(desktop): add nest commit identity guidance with human sign-off (#929) feat: provider/model selection for personas and runtime-aware env injection (#794) fix: reconcile agent profile on startup when relay publish was missed (#921) Revamp first-run onboarding (#924) Update setup loading screen (#926) fix(dm): keep hidden DMs hidden across refetch via relay-signed visibility snapshot (NIP-DV) (#857) Maximize desktop window on launch (#925) feat: preview features (experiments settings UI) (#888) fix(updater): send no-cache header on update check to avoid stale manifest (#922) fix(desktop): refresh channel state after unarchive (#923) Add channel visibility & ephemeral TTL controls to manage sidebar (#911) ci(release): add Intel macOS (x86_64) DMG as a release target (#748) Signed-off-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@sprout-oss.stage.blox.sqprod.co> # Conflicts: # desktop/src/features/sidebar/ui/AppSidebar.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two related changes that came out of improving thread behavior:
Runtime fix — persona is the source of truth at spawn.
Persona edits never reached agents created from a plain persona (not an installed pack). Spawn only consulted the live
PersonaRecordwhen bothpersona_pack_pathandpersona_name_in_packwere set, so non-pack agents fell through to the frozenrecord.system_promptsnapshot. Editing the persona left that snapshot stale — no restart could pick it up.The fix drops the
has_persona_packgate: the linked persona is resolved wheneverpersona_idis set (pack or not). Falls back to the record snapshot only when no persona is linked or it was deleted. Pack agents are unaffected (they already setpersona_id).Logic is extracted into a pure
resolve_effective_prompt_and_model()helper; the runtime test module moved toruntime/tests.rs(the existingenv_vars/tests.rspattern), which keepsruntime.rsunder the file-size limit.Docs — sharpen thread-depth & root-reporting conventions in
base_prompt.mdso the guidance is shared with every agent on next session.Design decision: persona always wins
For persona-linked agents the persona prompt is authoritative; per-agent Edit-Agent prompt overrides are intentionally a no-op for them. This is what keeps the fix to ~1 file. Per-agent tweaks, if ever wanted, are a separate clean feature.
Supersedes #729
#729 fixed the same bug but chose to preserve per-agent overrides, which required a new precedence model + a startup migration + provider-deploy wiring across 6 files, and was closed. This is the smaller persona-always-wins version.
Verification
cargo test --lib→ 456 passed, 0 failed (4 new tests: persona-wins, no-persona fallback, deleted-persona fallback, persona-clears-stale-model)cargo fmt --check,cargo clippy --lib(no warnings),cargo check --all-targets, file-size check — all clean