fix(gateway): keep the /branch parent read inside the create-failed guard

This commit is contained in:
kshitijk4poor
2026-09-26 22:16:16 +05:30
committed by kshitij
parent 87f5a07f66
commit 3307336404

View File

@@ -1042,8 +1042,8 @@ class GatewaySessionCommandsMixin:
# The child sends the parent's exact system prompt: a row without one makes the branch's
# first turn rebuild (re-probing the workspace) and forfeits the warm cache the copied
# transcript buys.
parent = await self._session_db.get_session(parent_session_id)
try:
parent = await self._session_db.get_session(parent_session_id)
await self._session_db.create_session(
session_id=new_session_id,
source=source.platform.value if source.platform else "gateway",