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

Function waitForAuthorizeUrl

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected