Skip to content

fix(session): consistent client identification for session lifecycle#150

Merged
zortos293 merged 1 commit intodevfrom
capy/session-client-id-polling
Mar 24, 2026
Merged

fix(session): consistent client identification for session lifecycle#150
zortos293 merged 1 commit intodevfrom
capy/session-client-id-polling

Conversation

@zortos293
Copy link
Collaborator

@zortos293 zortos293 commented Mar 23, 2026

Summary

Fixes session polling 500 errors by ensuring consistent client identification (nv-client-id and x-device-id) across the entire session lifecycle. Previously, each API call generated new random UUIDs, causing the server to reject poll requests as coming from a different client.

Changes

Session lifecycle identification

  • createSession now generates clientId and deviceId once and returns them in SessionInfo
  • pollSession and stopSession accept and reuse the same identifiers from session creation
  • Added clientId/deviceId fields to SessionInfo, SessionPollRequest, and SessionStopRequest interfaces in src/shared/gfn.ts

Header normalization

  • Refactored requestHeaders to accept options object with clientId, deviceId, and includeOrigin flags
  • Poll requests now omit Origin and Referer headers (matching claimSession pattern)
  • getActiveSessions and claimSession prefetch/validation calls updated to use new signature

Renderer integration

  • App.tsx now passes clientId and deviceId from SessionInfo to pollSession and stopSession calls

Open in Capy OPE-13 · Opus 4.5

@zortos293 zortos293 added the capy Generated by capy.ai label Mar 23, 2026 — with Capy AI
@zortos293 zortos293 merged commit 8a6c21c into dev Mar 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy Generated by capy.ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant