Repository navigation
Conversation
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a contained Pi-specific cache reconciliation fix with explicit handling for incomplete or malformed discovery responses. Production behavior is limited to removing stale models after valid discovery, with regression coverage for refresh failures, persistence, and restarts. You can add or adjust custom eligibility rules. Learn more. |
macroscopeapp
Bot
dismissed
their stale review
October 3, 2026 07:14
Dismissing prior approval to re-evaluate 94395e2
aliceisjustplaying
added a commit
to aliceisjustplaying/t3code
that referenced
this pull request
Oct 6, 2026
aliceisjustplaying
added a commit
to aliceisjustplaying/t3code
that referenced
this pull request
Oct 6, 2026
pingdotgg#15529's new test parses and writes JSON with JSON.parse/stringify inside Effect.gen, which the effect language service rejects (preferSchemaOverJson), so the server typecheck failed on fork-stack. `ours` does not have that code to change, so build-stack.sh now commits fixups/<pr>.patch once every PR is merged; applying it earlier changes pingdotgg#14941's conflict with pingdotgg#15079 and its recorded resolution no longer matches. The patch uses the Schema helpers pingdotgg#15079 adds to the same file.
aliceisjustplaying
added a commit
to aliceisjustplaying/t3code
that referenced
this pull request
Oct 6, 2026
aliceisjustplaying
added a commit
to aliceisjustplaying/t3code
that referenced
this pull request
Oct 6, 2026
pingdotgg#15529's new test parses and writes JSON with JSON.parse/stringify inside Effect.gen, which the effect language service rejects (preferSchemaOverJson), so the server typecheck failed on fork-stack. `ours` does not have that code to change, so build-stack.sh now commits fixups/<pr>.patch once every PR is merged; applying it earlier changes pingdotgg#14941's conflict with pingdotgg#15079 and its recorded resolution no longer matches. The patch uses the Schema helpers pingdotgg#15079 adds to the same file.
aliceisjustplaying
added a commit
to aliceisjustplaying/t3code
that referenced
this pull request
Oct 7, 2026
pingdotgg#15529's new test parses and writes JSON with JSON.parse/stringify inside Effect.gen, which the effect language service rejects (preferSchemaOverJson), so the server typecheck failed on fork-stack. `ours` does not have that code to change, so build-stack.sh now commits fixups/<pr>.patch once every PR is merged; applying it earlier changes pingdotgg#14941's conflict with pingdotgg#15079 and its recorded resolution no longer matches. The patch uses the Schema helpers pingdotgg#15079 adds to the same file.
aliceisjustplaying
added a commit
to aliceisjustplaying/t3code
that referenced
this pull request
Oct 7, 2026
pingdotgg#15529's new test parses and writes JSON with JSON.parse/stringify inside Effect.gen, which the effect language service rejects (preferSchemaOverJson), so the server typecheck failed on fork-stack. `ours` does not have that code to change, so build-stack.sh now commits fixups/<pr>.patch once every PR is merged; applying it earlier changes pingdotgg#14941's conflict with pingdotgg#15079 and its recorded resolution no longer matches. The patch uses the Schema helpers pingdotgg#15079 adds to the same file.
aliceisjustplaying
added a commit
to aliceisjustplaying/t3code
that referenced
this pull request
Oct 7, 2026
pingdotgg#15529's new test parses and writes JSON with JSON.parse/stringify inside Effect.gen, which the effect language service rejects (preferSchemaOverJson), so the server typecheck failed on fork-stack. `ours` does not have that code to change, so build-stack.sh now commits fixups/<pr>.patch once every PR is merged; applying it earlier changes pingdotgg#14941's conflict with pingdotgg#15079 and its recorded resolution no longer matches. The patch uses the Schema helpers pingdotgg#15079 adds to the same file.
aliceisjustplaying
added a commit
to aliceisjustplaying/t3code
that referenced
this pull request
Oct 8, 2026
pingdotgg#15529's new test parses and writes JSON with JSON.parse/stringify inside Effect.gen, which the effect language service rejects (preferSchemaOverJson), so the server typecheck failed on fork-stack. `ours` does not have that code to change, so build-stack.sh now commits fixups/<pr>.patch once every PR is merged; applying it earlier changes pingdotgg#14941's conflict with pingdotgg#15079 and its recorded resolution no longer matches. The patch uses the Schema helpers pingdotgg#15079 adds to the same file.
macroscopeapp
Bot
dismissed
their stale review
October 9, 2026 06:40
Dismissing prior approval to re-evaluate da26d9a
This branch has not been deployed
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.
Problem
After logging out of an upstream provider in Pi, T3 Code keeps that provider's cached models in the picker even when Pi's next successful discovery no longer returns them.
Refreshing or restarting T3 Code does not remove them because the registry merges missing Pi models back into the refreshed inventory and persists the merged result.
Reproduced with T3 Code
0.0.46-nightly.20261003.2610and Pi1.0.0: log out of OpenRouter while keeping another Pi provider connected, then refresh Pi's models in T3 Code.Pi's fresh inventory excluded OpenRouter, but T3 Code retained its cached entries.
Change
Treat a completed Pi discovery as the current model inventory, including a valid empty inventory after all providers are disconnected.
Keep previously discovered models when discovery fails, times out, needs interactive input, or has not completed.
Preserve currently configured custom models without restoring removed custom entries.
Reject malformed inventories through Pi's existing discovery failure path.
This is necessary before treating discovery as authoritative: a missing/non-array
modelsfield or an invalid model identity must not look like a successful empty or partial inventory and prune valid cached models.Scope and approval
This is a focused fix for an obvious model-cache bug under the small-fix exception in CONTRIBUTING.md.
It corrects reconciliation of an existing Pi inventory and adds regressions for that behavior; it introduces no settings, client changes, shared contracts, or changes to other providers' retention rules.
Both production changes address the same problem: replacing stale Pi models only when a complete, valid discovery establishes their removal.
Verification
Revalidated on macOS with Node
24.18.1after mergingmainat43f8a8de17.The fix follows the current package layout: Pi RPC validation is in
packages/provider-pi, and cache reconciliation is in the server'sProviderRegistry.Tests follow the same boundary without importing the server registry into the Pi package.
vp test run packages/provider-pi/src/server/status.test.ts apps/server/src/provider/ProviderRegistry.test.ts— 78 tests passed across both complete files, covering populated/empty RPC inventories, seven malformed-response cases, incomplete discovery, custom models, later failures, cache persistence, and registry restart.On macOS, ran with
SHELL=/bin/shand a PATH excluding Homebrew to keep the existing Codex binary-path probe deterministic.vp run --filter t3 --filter @t3tools/provider-pi typecheck— passed; existing Effect suggestions remain non-blocking.vp lintandvp fmt --checkon the four changed files — passed.knip --workspace apps/server --workspace packages/provider-pi --exports --preprocessor ./scripts/knip-schemas.ts --no-config-hints— passed.git diff --cached origin/main --check— passed for the complete PR diff.Pi tests exercise the real RPC probe with a mocked subprocess transport.
Registry tests exercise model reconciliation and the persisted cache lifecycle, including restart.
No real model calls or credentials were used.
The patched desktop package has not been built or tested in a live client; this remains a backend-only change, and repository-wide checks are left to CI as directed by AGENTS.md.