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

Method create_session

modules/agents/opencode/server.py:1084–1099  ·  view source on GitHub ↗
(self, directory: str, title: Optional[str] = None)

Source from the content-addressed store, hash-verified

1082 logger.info("OpenCode server left running for next vibe-remote instance to adopt")
1083
1084 async def create_session(self, directory: str, title: Optional[str] = None) -> Dict[str, Any]:
1085 async with self._request_scope():
1086 session = await self._get_http_session()
1087 body: Dict[str, Any] = {}
1088 if title:
1089 body["title"] = title
1090
1091 async with session.post(
1092 f"{self.base_url}/session",
1093 json=body,
1094 headers={"x-opencode-directory": _percent_encode_path(directory)},
1095 ) as resp:
1096 if resp.status != 200:
1097 text = await resp.text()
1098 raise RuntimeError(f"Failed to create session: {resp.status} {text}")
1099 return await resp.json()
1100
1101 async def fork_session(
1102 self,

Callers 1

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

Tested by

no test coverage detected