Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): allow V1 and V2 to run concurrently #12480

Mergedjuliusmarmingemerged 6 commits intot3code/codex-turn-mapping fromrefs/pull/12480/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Opening V2 while V1/nightly is running can leave the app with no environments because both desktop processes open the same Chromium profile. In a macOS two-process reproduction, the second process fails to open t3code:connection-runtime with an IndexedDB backing-store lock error.

Packaged V2 now uses its own t3code-v2 profile and never falls back to the V1 profile. On Windows, the new profile imports only Local State once to preserve the encryption keys used by saved connection credentials. All profile selection and Windows initialization now live in DesktopUserData.resolveUserDataPath, shared by startup and the Clerk bridge. Development profile handling stays unchanged. This profile is Electron storage under the OS application-data directory; the server T3 home and its databases stay where they are.

Targets #2829.

Validation:

  • 20 focused desktop tests pass. New coverage is limited to profile isolation and Windows credential preservation/error context.
  • Targeted lint and desktop typecheck pass.
  • Isolated macOS Electron reproduction: shared profile fails; separate V2 profile opens IndexedDB and commits a write while V1 stays running. This checks the storage failure directly, rather than launching the complete T3 app.

Before, shared profile:

Shared Electron profile fails to open IndexedDB

After, separate V2 profile:

Separate V2 profile opens IndexedDB and commits a write

Browser cookies and caches do not migrate, so websites opened inside V2 may require signing in again.

Prepared with Codex.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Effect Service Conventions found one blocking issue in apps/desktop/src/app/initializeV2DesktopProfile.ts: filesystem failures are wrapped at the whole-pipeline boundary without preserving the operation stage or relevant source resource. An inline review comment provides the expected fix.

      Posted via Macroscope — Effect Service Conventions
    3. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire—4.9 KiB—6.8 KiB✅
      CodexThread snapshot wire—3.7 KiB—4.9 KiB✅
      CodexLive turn WebSocket wire—1.2 KiB—2.0 KiB✅
      CodexLive turn WebSocket decoded—20.4 KiB—29.3 KiB✅
      CodexLive turn messages—2—8✅
      ClaudeTotal thread wire—4.9 KiB—6.8 KiB✅
      ClaudeThread snapshot wire—3.7 KiB—4.9 KiB✅
      ClaudeLive turn WebSocket wire—1.2 KiB—2.0 KiB✅
      ClaudeLive turn WebSocket decoded—20.8 KiB—29.3 KiB✅
      ClaudeLive turn messages—2—8✅

      Baseline: unavailable · PR result: 7f1069e · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 106.1 KiB
      • Claude decoded thread snapshot: 106.4 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This PR introduces startup-time profile migration and changes the production Electron user-data default to t3code-v2, affecting concurrent operation, browser state, and Windows credential metadata. A reported fresh-install startup failure remains unresolved, so the cross-platform initialization behavior requires human validation.

      Adjust the Minimum Blocking Severity for this repo — including turning it Off — in [Settings](https://app.macroscope.com/pingdotgg/settings#Repos). You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Effect Service Conventions found two blocking instances where Path.Path is manually extracted from DesktopEnvironment and provided to DesktopUserData.resolveUserDataPath, hiding the dependency from layer composition. Inline review comments identify both consumers and the expected fix.

      Posted via Macroscope — Effect Service Conventions
    6. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Effect Service Conventions found two blocking issues in DesktopAppIdentity.ts and DesktopClerk.ts: both manually inject Path.Path from DesktopEnvironment, hiding that dependency from Effect layer composition. Inline review comments provide the expected fix.

      Posted via Macroscope — Effect Service Conventions
    7. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Effect Service Conventions found two blocking issues. See the inline review comments on DesktopAppIdentity.ts and DesktopClerk.ts for the required dependency-composition fixes.

      Posted via Macroscope — Effect Service Conventions
    8. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Effect Service Conventions found two blocking dependency-acquisition violations; both are documented in inline review comments.

      Posted via Macroscope — Effect Service Conventions
    9. apps/desktop/src/app/DesktopUserData.ts line 60Resolvedby juliusmarminge
    10. juliusmarminge merged this84afa46

    11. juliusmarminge closed this

Sign in to join this conversation.