Fix session duplicate and branch field propagation - #3101
AlexeyDsov wants to merge 1 commit into
Conversation
|
Reading the diff at The bug is real and the fix surface is correct
The pre-PR duplicate handler at copied_session = Session(
session_id=uuid.uuid4().hex[:12],
title=(session.title or "Untitled") + " (copy)",
workspace=session.workspace,
model=session.model,
model_provider=session.model_provider,
messages=copy.deepcopy(session.messages),
tool_calls=copy.deepcopy(session.tool_calls),
...
personality=session.personality,
enabled_toolsets=getattr(session, "enabled_toolsets", None),
context_length=getattr(session, "context_length", None),
threshold_tokens=getattr(session, "threshold_tokens", None),
created_at=time.time(),
updated_at=time.time(),
)Everything else fell back to the The fix shape is rightThe deepcopy choices are correct:
Branch path at Test coverageBoth One minor concern: the tests construct a VerdictFix is correct, surgical, well-tested, addresses a real data-correctness bug. AI assistance disclosure is appreciated. LGTM. One nit: |
|
Shipped in v0.51.163 (Release EI, stage-batch45) via release PR #3149 — thank you, @AlexeyDsov! 🎉 Your duplicate/branch field-propagation fix is now on Cherry-picked onto current master (stale base), so GitHub didn't auto-close — closing manually. Full suite: 6871 passed, 0 failures. Closing as shipped. |
…nto stage-batch45
…nto stage-batch45
…nto stage-batch45
Short description
Session duplicate and branch operations were missing several critical fields, causing data loss scenarios:
Duplicate now copies all session configuration fields (with proper deep-copy for mutable types). Branch inherits model configuration, routing, and context engine state from the source session.
Added tests covering both duplicate and branch field propagation to prevent regression.
AI Assistance
This fix was developed with assistance from Qwen3.6-27B. The AI helped analyze the reconciliation logic, identify root cause, and draft the test scenarios.