MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / waitForAuthorizeUrl

Function waitForAuthorizeUrl

e2e/selfhost/mcp-opencode-consent.test.ts:49–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47
48 // Wait for OpenCode to "open the browser" (the shim records the URL).
49 const waitForAuthorizeUrl = async (): Promise<string> => {
50 const deadline = Date.now() + 90_000;
51 while (Date.now() < deadline) {
52 const url = home.openedUrls()[sinceIndex];
53 if (url) return url.trim();
54 await new Promise((tick) => setTimeout(tick, 250));
55 }
56 throw new Error("opencode never opened an authorization URL");
57 };
58
59 // The agent and the browser run concurrently: `opencode mcp auth` blocks on
60 // its localhost callback, which only fires once the browser completes the

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected