[Bug]: Pi model discovery times out at a fixed 15 s on slow (cold) Windows starts, leaving only "Pi default" in the picker
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- On Windows, install Pi (
@earendil-works/pi-coding-agent1.2.0) with a few user packages (pi-subagents, pi-web-access, pi-intercom, pi-usage, …) and log in to several providers. - Enable the Pi provider in T3 Code with
binaryPathpointing topi.cmd. - Start T3 Code while Pi is "cold" (first launch after boot, or with antivirus scanning
node_modules). Then open the model picker for Pi.
Expected behavior
The Pi model picker lists the models from get_available_models (for example openai-codex/gpt-6.1-sol or anthropic/claude-opus-5-5). If discovery fails, T3 should say so instead of quietly falling back.
Actual behavior
The picker shows only "Pi default". Discovery hits the hard-coded PI_RPC_DISCOVERY_TIMEOUT_MS = 15e3 in packages/provider-pi/src/server/status.ts. checkPiProviderStatus returns success after ~16–19 s, but with no discovered models, and discoverPiCommandsForCwd fails with PiRpcTimeoutError. The UI gives no sign that discovery timed out.
Pi itself is fine. On this machine, a warm pi --mode rpc --no-session answers get_state / get_available_models / get_commands in ~1.7–2.5 s. Cold starts, though, vary widely; I measured 12 s, 21 s and >30 s for the same command. That is typical of locked-down corporate Windows machines where endpoint security scans every file Node loads on first access. A fixed 15 s window is too tight for those machines.
Impact
Major degradation or frequent failure
Version or commit
T3 Code (Beta) desktop, server bundle binCli-CUds19Wg.mjs (installed 2026-10-16)
Environment
Windows 11 Enterprise 10.0.26200, Node v22.22.3, Pi 1.2.0 (pi.cmd via npm global), providers: anthropic, openai-codex, github-copilot, xai
Logs or stack traces
provider registry refresh failed; preserving cached providers
ProviderDriverError: Provider driver 'pi' failed to create instance 'pi': Failed to discover Pi workspace commands.
at refreshWorkspaceSnapshot (.../apps/server/dist/binCli-CUds19Wg.mjs:269319:40)
at ws.rpc.server.refreshProviders (.../apps/server/dist/binCli-CUds19Wg.mjs:307371:23) {
[cause]: PiRpcTimeoutError: Pi RPC discovery failed: timed out after 15000ms.
}
# trace spans
checkPiProviderStatus 18899 ms Success (no models discovered)
discoverPiCommandsForCwd 15476 ms Failure PiRpcTimeoutError
checkPiProviderStatus 15883 ms Success (no models discovered)
Workaround
- Refreshing the Pi provider after Pi has warmed up works until the next cold start.
- Trimming Pi's startup through the Pi "Launch arguments" setting helps somewhat. I used
--no-extensions -e <each package except pi-subagents> -e builtin:mcp -e builtin:llama.cpp, which cut warm startup from ~2.3 s to ~1.65 s. Cold starts still sometimes exceed 15 s. - Listing models under
customModelsavoids the timeout, but those models lose their thinking-level options.
Suggested fix
- Make the discovery timeout configurable in the Pi provider settings, or raise the default (for example to 60 s).
- Or retry discovery in the background after a timeout instead of keeping only "Pi default" until a manual refresh.
- Show a "model discovery timed out" warning on the Pi provider so users know why the model list is empty.
[!NOTE] Grok responding on behalf of Julius.
Thanks for the detailed timings. This is tracked by the open PR #15529, which raises the shared Pi status and workspace discovery deadline from 15 s to 30 s. If cold starts on your machine still go past 30 s with that change, please comment here. For a configurable timeout or a "discovery timed out" warning, please open an idea at https://github.com/pingdotgg/t3code/discussions/new?category=ideas