fix(session): synchronize the engine after foreign session import - #6369
Merged
Merged
Conversation
/resume <file> and inline-JSON imports install a new conversation without a SyncSession action, leaving the engine on the previous history; the next turn then runs against the wrong transcript. Carry the existing sync payload on ResumeImportReceipt (same shape as the /branch outcome) and map it to the SyncSession action in both import arms. Also adds the missing unit test for rebranch_active_messages_stamped: the shared prefix keeps ids and stamps, the new suffix keeps live stamps, and the replaced tail survives as a sibling branch. Follow-up to Hmbown#6367 (branch side closed by ffca963).
AdityaVG13
force-pushed
the
fix/resume-import-engine-sync
branch
from
September 20, 2026 04:05
bce89cd to
f3bc804
Compare
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
Follow-up to #6367 (branch side closed by
ffca963f9; this PR closes nothing)./resume <file>and inline-JSON imports install a whole new conversation —new session id plus transcript — but return a message-only result, so the
engine stays on the previous session's history and the next turn runs
against the wrong transcript. This carries the existing
SessionSyncPayloadon
ResumeImportReceipt(same shape as the/branchoutcome) and maps itto the
SyncSessionaction in both import arms, reusing the sharedsync_session_actionmapper — no new plumbing.Also adds the missing unit test for
rebranch_active_messages_stamped:shared prefix keeps ids and stamps, the new suffix keeps live stamps, and
the replaced tail survives as a sibling branch.
Testing
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features --locked(warning-free under the CI allow list)cargo test --workspace --all-features --locked— see note belowTargeted suites, all green on the remote worker (Spark):
session::resume::6 passed,stamped_rebranch1 passed,codewhale-command-contract --lib59 passed,lifecycle_portable_tests8 passed.Full-workspace note: the workspace run shows 8 failures, all in files this
diff does not touch, and all attributable to main-side churn or the remote
worker's headless environment:
route::export::golden_providers_export_matches_registry(golden stampedpre-0.10.0; release prep moved the version),
unknown_model_under_zai_never_infers_deepseek_provider_authority(provider-authority; zero references to the touched types),
clipboard_is_default_and_stdout_is_explicitandcommand_clipboard_export_preserves_structure_and_redacts_secrets(clipboard backend on a headless worker),
explicit_workspace_config_selects_its_route_without_locking_user_global(area churned by the session-bound account-model feat on main),
system_prompt_prefix_never_leaks_private_content,separate_predispatch_crashes_on_one_run_get_distinct_recovery_turn_ids,launch_mcp_summary_opens_manager_by_click_and_keyboard(PTY).The app-server crate was excluded on the rerun after its deterministic
failure so the remaining suites could execute; 46 suites passed.
Checklist
No-Issue: Follow-up to the already closed #6367; synchronizes foreign session imports without closing another issue.