MCPcopy
hub / github.com/anomalyco/opencode / waitForProjectIcon

Function waitForProjectIcon

packages/opencode/test/project/project.test.ts:98–107  ·  view source on GitHub ↗
(id: ProjectV2.ID, attempts = 50)

Source from the content-addressed store, hash-verified

96)
97
98function waitForProjectIcon(id: ProjectV2.ID, attempts = 50): Effect.Effect<Project.Info, never, Project.Service> {
99 return Effect.gen(function* () {
100 const project = yield* Project.Service
101 const info = yield* project.get(id)
102 if (info?.icon?.url) return info
103 if (attempts <= 0) throw new Error(`Project icon was not discovered: ${id}`)
104 yield* Effect.sleep("10 millis")
105 return yield* waitForProjectIcon(id, attempts - 1)
106 })
107}
108
109describe("Project.fromDirectory", () => {
110 it.live("should handle git repository with no commits", () =>

Callers 1

project.test.tsFile · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected