Open
Conversation
Refactor mergeOriginalFilesHashes function and add comprehensive unit tests - Changed the mergeOriginalFilesHashes function to be exported for external use. - Introduced a new test suite for mergeOriginalFilesHashes, covering various scenarios including handling undefined inputs, merging entries with different hashes, and deduplicating referencedBy and originalNames. - Ensured that version numbers are correctly managed and that fileNameToHash is built accurately from merged entries.
…-mergeoriginalfileshashes Added a resolver test for merging Original file hashes
When a project has a pinnedExtension for codex-editor, updateExtensionVersions now skips the codexEditor floor bump. This prevents the version gate from blocking collaborators who are intentionally running a pinned (older) version after the project was last opened on a newer build. frontierAuthentication ratcheting is unaffected.
Tests were disabled in aabd942 during a MetadataManager refactor with no specific failure documented. All existing tests pass cleanly in the current VS Code test environment. Adds three new cases to cover the pin-aware ratchet behaviour introduced in the previous commit: no-pin (ratchet works normally), codex-editor pin active (codexEditor bump suppressed), and frontier pin irrelevance (frontierAuthentication still ratchets when codex-editor is pinned).
Both codexEditor and frontierAuthentication ratchet checks now read from meta.pinnedExtensions (keyed by extension id) instead of the old singular meta.pinnedExtension object. Updates test fixtures to match.
On Windows, fs.writeFile can resolve before the written bytes are visible to a subsequent read, causing readFile to return empty content from a file that stat reports as non-empty. The function already retried on transient EntryNotFound errors; extend the same 25 ms retry loop to cover this empty-content case so callers are not spuriously blocked from saving.
One test in the search/replace suite was using a bare JSON.parse on a direct readFile call instead of the existing readJsonFromDiskWithRetry helper, making it susceptible to the same Windows filesystem flush timing flakiness that the helper was introduced to guard against.
Update ratchet suppression to use publisher.name format (e.g. 'project-accelerate.codex-editor-extension') instead of short names. Aligns with conductor's metadata.json key format.
auto-tag.yml now builds a VSIX and creates a GitHub Release on version bump. New pr-vsix.yml creates pre-releases for PR builds, with workflow_dispatch for manual testing.
- Adjust some of the posthog config to only use Identify event and usernames plus a random uuid.
This reverts commit 4810021.
Adds the full pinnedExtensions shape (version, url, reason, expiry, setBy) to the shared ProjectMetadata in types/index.d.ts so other parts of the codebase can use it without defining ad-hoc types.
Remove reason, expiry, and setBy fields — setBy is covered by git blame, expiry and reason are unnecessary complexity.
Align both ratchet-suppression methods to use existence checks for pins and consolidate ensureExtensionVersionsRecorded to a single metadata read.
…pression fix: suppress requiredExtensions ratchet when extensions are pinned
…b.com/genesis-ai-dev/codex-editor into 750-collect-stats-on-user-and-machine
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.
Closes #750
Summary
Integrates PostHog analytics into both the extension host and webviews to enable telemetry, error tracking, and opt-in session recording for diagnosing user issues.
What changed
1. Extension-side PostHog telemetry (
src/utils/telemetry.ts— new file)posthog-nodeclient on extension activation with system properties (OS, CPU, memory, VS Code version, extension version, locale).distinctIdis derived from the user's configured email, falling back toanonymous_<uuid>.captureEvent,captureException, andshutdownTelemetryhelpers.process.on("uncaughtException")andprocess.on("unhandledRejection")inextension.tsto report crashes.2. Webview-side PostHog JS (
webviews/codex-webviews/src/shared/posthog.ts— new file)window.__POSTHOG_CONFIG__injected by the extension host viawebviewTemplate.ts.posthog-jswith autocapture disabled, session recording conditionally enabled, and sensitive text masked via.ph-no-captureCSS class.window.onerrorandunhandledrejectionlisteners that forward exceptions to PostHog.3. React ErrorBoundary (
webviews/codex-webviews/src/shared/ErrorBoundary.tsx— new file)captureExceptionwith component stack traces.4. Session recording controls
CodexCellEditor,NavigationView,MainMenu,CommentsView,ParallelView. Other panels (CopilotSettings, CellLabelImporter, etc.) inject PostHog JS without recording.codex-editor-extension.sessionRecordingEnabledsetting (default:true) allows users to opt out.mainMenuProvider.tsreads/writes the setting and notifies the webview.5. Sensitive text obfuscation for recordings
ph-no-captureclass to translation content areas:TextCellEditor,CellContentDisplay,ChapterNavigationHeader,MilestoneAccordion,AudioHistoryViewer.ph-no-captureto MainMenu fields that display project metadata (project name, language info, email, etc.).6. Misc / DX fixes
src/test/suite/syncManager.test.ts: Updated test to align with current sync manager API changes on the parent branch.7. New Command to Disable
Dependencies added
posthog-node(extension host — server-side telemetry)posthog-js(webviews — client-side session recording & error capture)Test plan
initTelemetryruns without errors (check Output panel for[Telemetry]logs).codexfile and confirm session recording is active in one of the five enabled webviews (PostHog dashboard should show a session)ph-no-captureshould appear redacted)$exceptioneventnpm run lintandnpm run compile— no new errors