MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / validateLocalAgentServerPath

Function validateLocalAgentServerPath

scripts/dev-safe.mjs:1118–1135  ·  view source on GitHub ↗
(localPath)

Source from the content-addressed store, hash-verified

1116}
1117
1118export function validateLocalAgentServerPath(localPath) {
1119 if (!path.isAbsolute(localPath)) {
1120 throw new Error(
1121 `OH_AGENT_SERVER_LOCAL_PATH must be an absolute path, got: ${localPath}`,
1122 );
1123 }
1124 if (!existsSync(localPath)) {
1125 throw new Error(`OH_AGENT_SERVER_LOCAL_PATH does not exist: ${localPath}`);
1126 }
1127 for (const subdir of LOCAL_AGENT_SERVER_SUBDIRS) {
1128 const subdirPath = path.join(localPath, subdir);
1129 if (!existsSync(subdirPath)) {
1130 throw new Error(
1131 `OH_AGENT_SERVER_LOCAL_PATH is missing expected workspace package '${subdir}': ${subdirPath}`,
1132 );
1133 }
1134 }
1135}
1136
1137async function waitForServer(url, timeoutMs = DEFAULT_WAIT_TIMEOUT_MS) {
1138 const startedAt = Date.now();

Callers 4

mainFunction · 0.90
mainFunction · 0.90
dev-safe.test.tsFile · 0.90
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected