Skip to content
Source
Sign inSign up
pingdotgg/t3code

[codex] add Pi provider driver (AGENT MISTAKE) #2856

ClosedReynear(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/2856/headopened View on GitHub

Summary

Adds Pi as an experimental built-in provider for T3 Code.

  • wires Pi into provider settings, model defaults, picker metadata, and runtime event schemas
  • adds the server-side Pi driver, SDK-backed adapter, provider probe/model discovery, and unsupported text-generation shim
  • adds the Pi SDK dependency and lockfile updates
  • keeps the branch compatible with upstream TSGo checks by migrating remaining desktop Deferred imports and using Effect Crypto for Pi runtime identifiers

Validation

  • bun fmt
  • bun lint (passes with existing warnings)
  • bun typecheck
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: 0e66185d-bb01-44ab-8781-daf735fc217f

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. @@ -0,0 +299,21 @@
      299+ turnId: ctx.activeTurnId,
      300+ payload,
      301+ source,
      302+ method,
      303+ rawPayload,
      304+ }),
      305+ );
      306+ });
      307+
      308+ const requireSession = (
      309+ threadId: ThreadId,
      310+ ): Effect.Effect<GeminiSessionContext, ProviderAdapterSessionNotFoundError> => {
      311+ const ctx = sessions.get(threadId);
      312+ if (!ctx || ctx.stopped) {
      313+ return Effect.fail(
      314+ new ProviderAdapterSessionNotFoundError({ provider: PROVIDER, threadId }),
      315+ );
      316+ }
      317+ return Effect.succeed(ctx);
      318+ };
      319+
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟢 Low Layers/GeminiAdapter.ts:319

      Semaphores in threadLocksRef are created per-thread but never removed when sessions stop. At line 330, sessions.delete(ctx.threadId) removes the session, but the corresponding semaphore remains in threadLocksRef. If many unique threadId values are used, the map grows unboundedly, causing a memory leak. Consider deleting the semaphore from threadLocksRef when stopping a session.

      🤖 Copy this AI Prompt to have your agent fix this:
      In file apps/server/src/provider/Layers/GeminiAdapter.ts around line 319:
      
      Semaphores in `threadLocksRef` are created per-thread but never removed when sessions stop. At line 330, `sessions.delete(ctx.threadId)` removes the session, but the corresponding semaphore remains in `threadLocksRef`. If many unique `threadId` values are used, the map grows unboundedly, causing a memory leak. Consider deleting the semaphore from `threadLocksRef` when stopping a session.
      
      Evidence trail:
      apps/server/src/provider/Layers/GeminiAdapter.ts line 218: threadLocksRef = SynchronizedRef.make(new Map<string, Semaphore.Semaphore>()). Lines 228-244: getThreadSemaphore creates+inserts entries. Lines 320-338: stopSessionInternal deletes from `sessions` (line 330) but never from `threadLocksRef`. git_grep for 'threadLocksRef' confirms only two references (lines 218, 229) — no deletion path exists.
    4. Reynear(GitHub profile, opens in a new tab) changed the title

Sign in to join this conversation.