Skip to content

fix(companion): stop the relationship bond from freezing on every save - #96

Merged
MegalithOfficial merged 1 commit into
LettuceAI:mainfrom
Husky110:fix/companion-relationship-continuity-reset
Sep 6, 2026
Merged

MegalithOfficial merged 1 commit into
LettuceAI:mainfrom
Husky110:fix/companion-relationship-continuity-reset

Conversation

@Husky110

@Husky110 Husky110 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

The relationship bond (closeness/trust/affection/tension) and the interaction counter never advanced despite many turns, while the emotional engine evolved normally.

Cause: on save, resolve_companion_state_json ran merge_continuity_into_state over the session's freshly evolved companion state. That merge overwrites relationshipState with the value from the shared continuity store — so the just-evolved bond (and interaction_count) was discarded before persist_continuity_from_state could write it back, permanently resetting it to the stored/default value each turn. emotionalState survived only because the merge does not touch it.

Add a pull_relationship flag to merge_continuity_into_state:

  • load/hydrate passes true (shared bond is the source of truth on load),
  • save passes it only for a fresh session with no state yet (inherit the shared bond); a session that already carries its own state keeps its authoritative, possibly-evolved bond so persist promotes it to the store.

Add a regression test covering evolve -> save -> reload.

The relationship bond (closeness/trust/affection/tension) and the
interaction counter never advanced despite many turns, while the emotional
engine evolved normally.

Cause: on save, resolve_companion_state_json ran merge_continuity_into_state
over the session's freshly evolved companion state. That merge overwrites
relationshipState with the value from the shared continuity store — so the
just-evolved bond (and interaction_count) was discarded before
persist_continuity_from_state could write it back, permanently resetting it
to the stored/default value each turn. emotionalState survived only because
the merge does not touch it.

Add a pull_relationship flag to merge_continuity_into_state:
- load/hydrate passes true (shared bond is the source of truth on load),
- save passes it only for a fresh session with no state yet (inherit the
  shared bond); a session that already carries its own state keeps its
  authoritative, possibly-evolved bond so persist promotes it to the store.

Add a regression test covering evolve -> save -> reload.
@MegalithOfficial
MegalithOfficial merged commit 96265c5 into LettuceAI:main Sep 6, 2026
5 checks passed
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.

2 participants