MCPcopy Index your code
hub / github.com/anomalyco/opencode / assertOpencodeConnected

Function assertOpencodeConnected

github/index.ts:270–291  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

268}
269
270async function assertOpencodeConnected() {
271 let retry = 0
272 let connected = false
273 do {
274 try {
275 await client.app.log<true>({
276 body: {
277 service: "github-workflow",
278 level: "info",
279 message: "Prepare to react to GitHub Workflow event",
280 },
281 })
282 connected = true
283 break
284 } catch {}
285 await sleep(300)
286 } while (retry++ < 30)
287
288 if (!connected) {
289 throw new Error("Failed to connect to opencode server")
290 }
291}
292
293function assertContextEvent(...events: string[]) {
294 const context = useContext()

Callers 1

index.tsFile · 0.85

Calls 1

sleepFunction · 0.50

Tested by

no test coverage detected