fix: inject PostHog config into release builds - #426
Merged
Conversation
dimavedenyapin
added a commit
that referenced
this pull request
Jul 27, 2026
…nflicts) Brings the transcript stack up to date with main (10 commits: PostHog analytics #424/#425/#426, codex fixes #423/#427, releases) and resolves the conflicts for the #421 → main merge. Key resolutions: - agent-manager.ts resumeAdapterSession / replayMissedTranscriptPartsBeforeIdle: keep our event-sourced model (resume never replays history to the renderer; clients render the durable projection) AND keep main's #427 assistantTextKeys codex reconciled-text dedup. In the idle-replay path both dedup layers now run — main's assistantTextKeys AND our projection-content dedup — which are complementary against the codex agent-msg_/agent-item id-scheme mismatch. - Renderer + mobile agent-store: took our projection-cache rewrite and re-applied main's PostHog telemetry (agent_session_status_changed, agent_output_batch_received, agent_approval_requested, agent_created/updated/deleted, agent_session_stopped). - use-agent-session.ts: kept the "Starting…"/pendingSend send flow AND main's agent_message_sent analytics in both send branches. - agent-manager.test.ts: kept BOTH codex-dedup regression tests (projection-content and assistantTextKeys) as separate cases, since both mechanisms now exist. Verified: typecheck clean, build ✓, full suite 1579 passing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
electron.vite.config.ts.POSTHOG_KEYand telemetry settings into all releasepnpm buildjobs for macOS, Windows, and Linux.releaseenvironment so environment-scoped secrets and vars are available consistently.Release setup
POSTHOG_KEYas a GitHub Environment secret on thereleaseenvironment.POSTHOG_HOST,TELEMETRY_ENABLED,TELEMETRY_FLUSH_BATCH_SIZE,TELEMETRY_MAX_BUFFERED_EVENTS.pnpm build; runtime env vars can still override them when present.Test plan
pnpm install --frozen-lockfile --ignore-scripts(local Node 26 workaround; CI uses Node 22 with scripts enabled)pnpm typecheckpnpm exec eslint electron.vite.config.ts src/main/analytics-service.tsPOSTHOG_KEY=phc_build_test POSTHOG_HOST=https://us.i.posthog.com TELEMETRY_ENABLED=true TELEMETRY_FLUSH_BATCH_SIZE=20 TELEMETRY_MAX_BUFFERED_EVENTS=1000 pnpm buildGenerated with Codex