🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
test(oauth): allow loaded CI time for loopback requests
Rudy Celeklie225851d85aa
diff --git a/v3/@claude-flow/cli/__tests__/auth-browser-callback.test.ts b/v3/@claude-flow/cli/__tests__/auth-browser-callback.test.tsindex f362e65f32..c7db22e50c 100644--- a/v3/@claude-flow/cli/__tests__/auth-browser-callback.test.ts+++ b/v3/@claude-flow/cli/__tests__/auth-browser-callback.test.ts@@ -6,13 +6,13 @@ vi.mock('../src/auth/security-bridge.js', () => ({loadSecurityOAuth: async () => ({CallbackServer: { bind: async () => {const server = await CallbackServer.bind();- return { redirectUri: server.redirectUri, awaitCallback: () => server.awaitCallback(200) };+ return { redirectUri: server.redirectUri, awaitCallback: () => server.awaitCallback(3_000) };} },generatePkce: () => ({ state: 'expected', codeChallenge: 'challenge', codeVerifier: 'verifier' }),authorizeUrl: (redirect: string) => redirect,openBrowser: async (url: string) => {// Complete the real loopback callback before openBrowser returns.- const response = await fetch(`${url}?code=received&state=${scenario.state}`, { signal: AbortSignal.timeout(100) });+ const response = await fetch(`${url}?code=received&state=${scenario.state}`, { signal: AbortSignal.timeout(2_000) });await response.text();},exchangeCode,@@ -25,10 +25,10 @@ describe('browser login callback boundary', () => {exchangeCode.mockResolvedValue({ access_token: 'access', token_type: 'Bearer' });await expect(browserLogin(() => {})).resolves.toEqual({ tokens: { access_token: 'access', token_type: 'Bearer' }, method: 'pkce' });expect(exchangeCode).toHaveBeenCalledWith('received', 'verifier', expect.stringMatching(/^http:\/\/127\.0\.0\.1:\d+\/oauth\/callback$/));- });+ }, 10_000);it('rejects a mismatched callback state without exchanging its code', async () => {scenario.state = 'mismatched';await expect(browserLogin(() => {})).rejects.toBeInstanceOf(StateMismatchError);expect(exchangeCode).not.toHaveBeenCalled();- });+ }, 10_000);});diff --git a/v3/@claude-flow/security/__tests__/oauth-callback-routing.test.ts b/v3/@claude-flow/security/__tests__/oauth-callback-routing.test.tsindex 60d1beacae..20c1d23a10 100644--- a/v3/@claude-flow/security/__tests__/oauth-callback-routing.test.ts+++ b/v3/@claude-flow/security/__tests__/oauth-callback-routing.test.ts@@ -8,7 +8,7 @@ function send(url: string, method = 'GET'): Promise<number> {res.resume();res.on('end', () => resolve(res.statusCode!));});- req.setTimeout(100, () => req.destroy(new Error('request timed out')));+ req.setTimeout(2_000, () => req.destroy(new Error('request timed out')));req.on('error', reject);req.end();});@@ -18,7 +18,7 @@ describe('OAuth loopback callback routing', () => {for (const [path, method, status] of [['/favicon.ico', 'GET', 404], ['/oauth/callback', 'POST', 405]] as const) {it(`ignores ${method} ${path} and still receives the OAuth callback`, async () => {const server = await CallbackServer.bind();- const result = server.awaitCallback(300).catch(error => error);+ const result = server.awaitCallback(3_000).catch(error => error);try {expect(await send(`http://127.0.0.1:${server.port}${path}`, method)).toBe(status);expect(await send(`${server.redirectUri}?code=legitimate&state=expected`)).toBe(200);@@ -30,8 +30,8 @@ describe('OAuth loopback callback routing', () => {const server = await CallbackServer.bind();try {expect(await send(`${server.redirectUri}?code=early&state=original`)).toBe(200);- expect(await server.awaitCallback(30)).toEqual({ code: 'early', state: 'original', error: null });- } finally { await server.awaitCallback(30).catch(() => {}); }+ expect(await server.awaitCallback(500)).toEqual({ code: 'early', state: 'original', error: null });+ } finally { await server.awaitCallback(500).catch(() => {}); }});it('still times out when no callback arrives', async () => {const server = await CallbackServer.bind();