MCPcopy Create free account
hub / github.com/avibe-bot/avibe / fork_session

Method fork_session

modules/agents/opencode/server.py:1101–1120  ·  view source on GitHub ↗
(
        self,
        source_session_id: str,
        directory: str,
        message_id: Optional[str] = None,
    )

Source from the content-addressed store, hash-verified

1099 return await resp.json()
1100
1101 async def fork_session(
1102 self,
1103 source_session_id: str,
1104 directory: str,
1105 message_id: Optional[str] = None,
1106 ) -> Dict[str, Any]:
1107 async with self._request_scope():
1108 session = await self._get_http_session()
1109 body: Dict[str, Any] = {}
1110 if message_id:
1111 body["messageID"] = message_id
1112 async with session.post(
1113 f"{self.base_url}/session/{source_session_id}/fork",
1114 json=body,
1115 headers={"x-opencode-directory": _percent_encode_path(directory)},
1116 ) as resp:
1117 if resp.status != 200:
1118 text = await resp.text()
1119 raise RuntimeError(f"Failed to fork session: {resp.status} {text}")
1120 return await resp.json()
1121
1122 async def send_message(
1123 self,

Calls 6

_request_scopeMethod · 0.95
_get_http_sessionMethod · 0.95
_percent_encode_pathFunction · 0.85
postMethod · 0.45
textMethod · 0.45
jsonMethod · 0.45