From 81700a1a149ef2f7ee32c70d0d4ea8d216fc6ff7 Mon Sep 17 00:00:00 2001 From: 777genius Date: Sat, 9 May 2026 05:52:26 +0300 Subject: [PATCH] test(team): harden live launch smoke matrix --- scripts/prove-agent-cli-launch.mjs | 5 +++++ src/main/services/team/TeamProvisioningService.ts | 4 ++++ test/main/utils/AgentCliLaunch.live-e2e.test.ts | 2 ++ 3 files changed, 11 insertions(+) diff --git a/scripts/prove-agent-cli-launch.mjs b/scripts/prove-agent-cli-launch.mjs index df0f2c35..68d5e7c5 100644 --- a/scripts/prove-agent-cli-launch.mjs +++ b/scripts/prove-agent-cli-launch.mjs @@ -7,13 +7,18 @@ import { fileURLToPath } from 'node:url'; const scriptDir = path.dirname(fileURLToPath(import.meta.url)); const repoRoot = path.resolve(scriptDir, '..'); +const siblingOrchestrator = path.resolve(repoRoot, '..', 'agent_teams_orchestrator'); const env = { ...process.env, AGENT_CLI_LAUNCH_LIVE_E2E: '1', + CLAUDE_TEAM_CLI_FLAVOR: process.env.CLAUDE_TEAM_CLI_FLAVOR || 'agent_teams_orchestrator', + CLAUDE_AGENT_TEAMS_ORCHESTRATOR_CLI_PATH: + process.env.CLAUDE_AGENT_TEAMS_ORCHESTRATOR_CLI_PATH || path.join(siblingOrchestrator, 'cli'), }; console.log('Running agent CLI launch live smoke'); +console.log(`Claude runtime: ${env.CLAUDE_AGENT_TEAMS_ORCHESTRATOR_CLI_PATH}`); const result = spawnSync( 'pnpm', diff --git a/src/main/services/team/TeamProvisioningService.ts b/src/main/services/team/TeamProvisioningService.ts index 8d4431bd..aa201676 100644 --- a/src/main/services/team/TeamProvisioningService.ts +++ b/src/main/services/team/TeamProvisioningService.ts @@ -872,6 +872,10 @@ const HANDLED_STREAM_JSON_TYPES = new Set([ 'user', 'assistant', 'control_request', + // Claude Code can emit informational rate-limit allowance snapshots as + // top-level stream-json events. They are not errors; actionable retry/error + // diagnostics still arrive through system/api_retry and remain handled below. + 'rate_limit_event', 'result', 'system', ]); diff --git a/test/main/utils/AgentCliLaunch.live-e2e.test.ts b/test/main/utils/AgentCliLaunch.live-e2e.test.ts index 582a5d5b..476c28ae 100644 --- a/test/main/utils/AgentCliLaunch.live-e2e.test.ts +++ b/test/main/utils/AgentCliLaunch.live-e2e.test.ts @@ -7,6 +7,7 @@ import { promisify } from 'util'; import { describe, expect, it } from 'vitest'; import { CodexBinaryResolver } from '@main/services/infrastructure/codexAppServer/CodexBinaryResolver'; +import { ClaudeBinaryResolver } from '@main/services/team/ClaudeBinaryResolver'; import { execCli, killProcessTree, spawnCli } from '@main/utils/childProcess'; const execFileAsync = promisify(execFile); @@ -42,6 +43,7 @@ const AGENT_CLI_SPECS: AgentCliSpec[] = [ command: 'claude', overrideEnv: 'CLAUDE_CLI_PATH', versionPattern: /\b\d+\.\d+\.\d+\b.*Claude Code/i, + resolver: () => ClaudeBinaryResolver.resolve(), }, ];