CYPHER_GET_ACTIVE_BRANCH_HEAD = '\nMATCH (
t:Thread {thread_id: $thread_id, checkpoint_ns: $checkpoint_ns})\n -[:ACTIVE_BRANCH]->(b:Branch)\n -[:HEAD]->(c:Checkpoint)\nOPTIONAL MATCH (c)-[:PREVIOUS]->(parent:Checkpoint
)\nRETURN t.thread_id as thread_id,\n t.checkpoint_ns as checkpoint_ns,\n c.checkpoint_id as checkpoint_id,\n parent.checkpoint_id as parent_checkpoint_id,\n c.type as type,\n c.checkpoint as checkpoint,\n c.metadata as metadata,\n b.branch_id as branch_id,\n b.name as branch_name\n'