From 33073364048899062eff26a1850a56c7fc1d3d0d Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Sat, 26 Sep 2026 22:16:16 +0530 Subject: [PATCH] fix(gateway): keep the /branch parent read inside the create-failed guard --- gateway/slash_commands_session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gateway/slash_commands_session.py b/gateway/slash_commands_session.py index e64d9dd118..c6f26bef60 100644 --- a/gateway/slash_commands_session.py +++ b/gateway/slash_commands_session.py @@ -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",