Skip to content

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
developfrom
scott/preserve-conversational-chat-memory
Open

feat(evolve): enhance EvolveState to track last evolution state and preserve chat memory for conversational Begin's#173
Scott McMaster (scottmcmaster) wants to merge 3 commits into
developfrom
scott/preserve-conversational-chat-memory

Conversation

@scottmcmaster
Copy link
Copy Markdown
Contributor

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

  • Docs updated
  • No docs update needed

…reserve chat memory for conversational Begin's
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 16, 2026

Warnings
⚠️ Please assign this PR to someone (usually yourself).
Messages
📖 No docs update needed — acknowledged.

📋 PR Overview

Lines changed 70 (+61 / -9)
Files 0 added, 4 modified, 0 deleted
Draft / WIP no
Has Test Plan yes
New UI components no
New Storybook stories no
New Rust modules no
New TS source files no
New tests no
package.json touched no
Cargo.toml touched no
Infra / CI touched no

🔬 Coverage

Report Lines Statements Functions Branches
apps/native/coverage/coverage-summary.json 17.3% 17.3% 27.8% 52.9%

Generated by 🚫 dangerJS against 786f262

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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> to EvolveState (with serde defaulting for backwards compatibility).
  • Update evolve lifecycle to persist last_evolution_state for 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.

Comment thread apps/native/src-tauri/src/state/evolve_state.rs Outdated
Comment thread apps/native/src-tauri/src/evolve/lifecycle.rs Outdated
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>
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