diff --git a/.github/workflows/manual-e2e.yml b/.github/workflows/manual-e2e.yml index b460e69d..8294f152 100644 --- a/.github/workflows/manual-e2e.yml +++ b/.github/workflows/manual-e2e.yml @@ -86,7 +86,7 @@ jobs: working-directory: agents-ui run: | if [ -f .npmrc.template ]; then - sed "s/\$NPM_AUTH_TOKEN/${{ secrets.NPM_TOKEN }}/g" .npmrc.template > .npmrc + sed "s/\$NPM_AUTH_TOKEN/${{ secrets.NPM_PACKAGE_UPLOAD_TOKEN }}/g" .npmrc.template > .npmrc fi - name: Install local SDK build in agents-ui diff --git a/.github/workflows/pr-main-e2e.yml b/.github/workflows/pr-main-e2e.yml index 5e77a59b..e3dafec2 100644 --- a/.github/workflows/pr-main-e2e.yml +++ b/.github/workflows/pr-main-e2e.yml @@ -82,7 +82,7 @@ jobs: working-directory: agents-ui run: | if [ -f .npmrc.template ]; then - sed "s/\$NPM_AUTH_TOKEN/${{ secrets.NPM_TOKEN }}/g" .npmrc.template > .npmrc + sed "s/\$NPM_AUTH_TOKEN/${{ secrets.NPM_PACKAGE_UPLOAD_TOKEN }}/g" .npmrc.template > .npmrc fi - name: Install local SDK build in agents-ui diff --git a/.github/workflows/pr-prod-e2e.yml b/.github/workflows/pr-prod-e2e.yml index 12f9dfb9..fd9e82df 100644 --- a/.github/workflows/pr-prod-e2e.yml +++ b/.github/workflows/pr-prod-e2e.yml @@ -52,12 +52,12 @@ jobs: - name: Render .npmrc for agents-ui working-directory: agents-ui + env: + NPM_AUTH_TOKEN: ${{ secrets.NPM_PACKAGE_UPLOAD_TOKEN }} run: | if [ -f .npmrc.template ]; then envsubst < .npmrc.template > .npmrc fi - env: - NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Install staging SDK version working-directory: agents-ui diff --git a/.github/workflows/publish-on-merge.yml b/.github/workflows/publish-on-merge.yml index 5a1db44d..79bf3c60 100644 --- a/.github/workflows/publish-on-merge.yml +++ b/.github/workflows/publish-on-merge.yml @@ -41,7 +41,7 @@ jobs: sudo chmod +x /usr/local/bin/logger - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: 20 registry-url: "https://registry.npmjs.org" @@ -113,7 +113,7 @@ jobs: - name: Publish to NPM env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_PACKAGE_UPLOAD_TOKEN }} run: | if [ "${{ github.event.inputs.dry_run }}" = "true" ]; then logger -l info -m "🔍 DRY RUN MODE: Would publish version ${{ steps.version.outputs.version }} with tag ${{ steps.version.outputs.tag }}" diff --git a/src/services/streaming-manager/livekit-manager.ts b/src/services/streaming-manager/livekit-manager.ts index 822437ff..f082e323 100644 --- a/src/services/streaming-manager/livekit-manager.ts +++ b/src/services/streaming-manager/livekit-manager.ts @@ -35,6 +35,8 @@ import type { import { createVideoStatsMonitor } from './stats/poll'; import { VideoRTCStatsReport } from './stats/report'; +const TRACK_SUBSCRIPTION_TIMEOUT_MS = 20000; + async function importLiveKit(): Promise<{ Room: typeof Room; RoomEvent: typeof RoomEvent; @@ -93,7 +95,7 @@ export async function createLiveKitStreamingManager | null = null; - const TRACK_SUBSCRIPTION_TIMEOUT_MS = 20000; let currentActivityState: AgentActivityState = AgentActivityState.Idle; const streamApi = createStreamApiV2(auth, baseURL || didApiUrl, agentId, callbacks.onError); @@ -166,7 +167,9 @@ export async function createLiveKitStreamingManager { - log('Track subscription timeout - no track subscribed within 30 seconds after connect'); + log( + `Track subscription timeout - no track subscribed within ${TRACK_SUBSCRIPTION_TIMEOUT_MS / 1000} seconds after connect` + ); trackSubscriptionTimeoutId = null; analytics.track('connectivity-error', { error: 'Track subscription timeout', @@ -252,12 +255,6 @@ export async function createLiveKitStreamingManager { log(`Video state change: ${state}`); if (state === StreamingState.Start) { + if (trackSubscriptionTimeoutId) { + clearTimeout(trackSubscriptionTimeoutId); + trackSubscriptionTimeoutId = null; + log('Track subscription timeout cleared'); + } handleVideoStarted(); } else if (state === StreamingState.Stop) { handleVideoStopped(report);