feat(evolve): enhance EvolveState to track last evolution state and preserve chat memory for conversational Begin's#173
Open
Scott McMaster (scottmcmaster) wants to merge 3 commits into
Conversation
…reserve chat memory for conversational Begin's
Copilot started reviewing on behalf of
Scott McMaster (scottmcmaster)
May 16, 2026 03:02
View session
Contributor
📋 PR Overview
🔬 Coverage
|
There was a problem hiding this comment.
Pull request overview
This PR extends the persisted EvolveState to track the most recently observed EvolutionState, and uses that to avoid clearing in-memory chat context when re-entering Begin after a conversational (no-edits) evolution result—preventing unexpected agent behavior on follow-up prompts.
Changes:
- Add
last_evolution_state: Option<EvolutionState>toEvolveState(with serde defaulting for backwards compatibility). - Update evolve lifecycle to persist
last_evolution_statefor conversational, successful, and failure paths. - Adjust Begin-step chat-memory clearing logic to preserve memory for conversational Begin cycles and expand unit tests accordingly.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/native/src-tauri/src/state/evolve_state.rs | Adds conversational-preservation logic for Begin and updates tests for chat-memory clearing behavior. |
| apps/native/src-tauri/src/shared_types/evolve.rs | Extends EvolveState with a new persisted last_evolution_state field. |
| apps/native/src-tauri/src/managed_edits/managed_edit.rs | Updates EvolveState struct literal initialization to include the new field. |
| apps/native/src-tauri/src/evolve/lifecycle.rs | Persists last_evolution_state for conversational short-circuit, successful evolution completion, and failure recovery. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ilot reviewer comment) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Summary
Adds the last evolution state to the EvolveState structure, which seems generally useful, but specifically useful to fix a case where we'd clear chat memory when re-entering Begin on a conversational response to Begin, which can cause unexpected agent behavior on follow-up requests.
Test Plan
Updated unit tests and did manual testing that proved this fixes the conversational Begin behavior I referred to.
Docs