Skip to content

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

Closed
Reynear wants to merge 2 commits into
pingdotgg:mainfrom
Reynear:codex/add-pi-provider
Closed

[codex] add Pi provider driver (AGENT MISTAKE)#2856
Reynear wants to merge 2 commits into
pingdotgg:mainfrom
Reynear:codex/add-pi-provider

Conversation

@Reynear

@Reynear Reynear commented May 29, 2026

Copy link
Copy Markdown

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

@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels May 29, 2026
}
return Effect.succeed(ctx);
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.

Comment thread packages/contracts/src/settings.ts Outdated
@Reynear
Reynear force-pushed the codex/add-pi-provider branch from 95b2705 to 71c7733 Compare May 29, 2026 04:07
@Reynear Reynear closed this May 29, 2026
@Reynear
Reynear deleted the codex/add-pi-provider branch May 29, 2026 04:13
@Reynear Reynear changed the title [codex] add Pi provider driver [codex] add Pi provider driver (AGENT MISTAKE) May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant