[Bug]: Local desktop environment enters reconnecting after foreground health check timeout #3553
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/web
Steps to reproduce#
- Open T3 Code Desktop on Windows.
- Open an existing Codex-backed chat thread.
- Let the agent work for a while, or switch away from the app and return while a session is active.
- Observe the environment banner after the app becomes active again.
I do not have a perfectly deterministic repro yet, but it has happened during an active chat session and often recovers by itself.
Expected behavior#
A busy-but-alive local desktop backend should not be marked as reconnecting after a single slow foreground health check.
If the active turn is still running, the composer can remain draft-only / not send a second turn, but the environment should stay connected unless the WebSocket or backend is actually unavailable.
Actual behavior#
The environment enters reconnecting state and shows:
KLB: Failed to connect. Reconnecting... Reason: KLB did not respond to a connection health check.
During this state, the composer/send path can become unavailable. The backend often appears to recover by itself, so this looks like a transient liveness/probe false positive rather than a full backend crash.
Impact#
Major degradation or frequent failure
Version or commit#
0.0.28-nightly.20260625.645
Environment#
Windows 11 Pro 25H2, T3 Code Desktop, Node v24.15.0, Codex v0.142.0, GPT5.5 xhight
Logs or stack traces#
Relevant UI banner:
KLB: Failed to connect. Reconnecting... Reason: KLB did not respond to a connection health check.
KLB did not respond to a connection health check.
Local investigation:
- `packages/client-runtime/src/connection/supervisor.ts` appears to run `lease.session.probe` on `application-active`.
- `CONNECTION_PROBE_TIMEOUT` is currently `15 seconds`.
- `packages/client-runtime/src/rpc/session.ts` appears to implement `probe` via `serverGetConfig({})`.
This may be too heavy for a liveness probe when the backend is busy but still alive.
Screenshots, recordings, or supporting files#
Capture d'écran 2026-06-25 130538.png
Workaround#
Usually waiting lets the environment reconnect by itself. I have not found a reliable workaround besides waiting or reconnecting/restarting the app if it gets stuck.
Possibly related:
#2677 Skip healthy env reconnects after browser resume
- This looks very close to this failure class. It previously avoided reconnect churn on browser/app resume when the heartbeat was still fresh.
- In the current source I inspected, I could not find
isHeartbeatFresh/lastBrowserResumeReconnectAt, so this may be a regression or refactor gap.
#3500 Raise RPC WebSocket ping interval to prevent reconnect loop on large workspaces
- Related class of issue: backend stays alive but is too busy to respond quickly, causing false reconnect behavior.
-
- Related to slow reconnect/replay/enrichment paths causing client-visible connection pressure.
A narrow fix could be:
- Avoid reconnecting after a single foreground probe timeout if the WebSocket has not actually closed.
- Coalesce repeated
application-activeprobes while one probe is already in flight. - Consider using a lighter liveness RPC than
serverGetConfig({})for connection health checks.
KLB39(GitHub profile, opens in a new tab) added labelsbug
KLB39(GitHub profile, opens in a new tab) added labelsneeds-triage
I see the same behavior. Windows 25H2, aarm64. Node v22.21.1, T3Code nightly.
It started happening on nightly around 06/16 - 06/18. Since it reconnects after a few seconds anyways, I waited patiently. The more annoying behavior however, is that the chat textbox gets disabled, and I can't continue typing.
The more annoying behavior however, is that the chat textbox gets disabled, and I can't continue typing.
Seeing this from the 0.0.28 stable as well. Window x86 desktop app My network environment didn't change, and I start to get disconnected by the network check after upgrading from the previous stable. also 100% agree that disabling the text entry when being disconnected is very annoying
The more annoying behavior however, is that the chat textbox gets disabled, and I can't continue typing.
To save some sanity I am using the Windows PowerToys "AlwaysOnTop" feature.
I also wonder if this class of behaviour is also why I observe a multi-task activity not actually update the "Tasks" sidebar until after they are all completed.
Getting the same issue on Windows 10 desktop with T3 Code 0.0.28
It usually recovers after a bit, but while it is reconnecting the I'm unable to send any prompts, which makes active sessions painful to use. I've tried connecting to different networks but the problem persists. This wasn't happening for previous versions.
This is insanely annoying. happens every few minutes, fully blocking usage. Windows 11, nightly build. I also had Windows PowerToys "AlwaysOnTop" feature enabled, but disabling did not help. This has been slowly getting worse and worse. I have no Connections enabled, but had Tailscape enabled at somepoint.
After some digging:
- T3’s local server.getConfig health request taking 10.7 seconds, dangerously close to the reported 15-second timeout.
- Git/VCS status operations taking 8–11 seconds, with repeated Git timeouts for several projects
- A nonexistent thread (9151ad3e-…) being resubscribed approximately once per second.
- Extremely heavy trace generation under ~/.t3/userdata/logs—around 100 MB rotated within minutes.
Your T3 database is 3.78 GB, containing:
- 915 threads
- 32,187 messages
- 265,806 activity records
- 1,543,000+ orchestration events
Approximate storage breakdown:
- Orchestration events: 1.64 GB
- Projected activity: 651 MB
- Command receipts: 288 MB
- Event/receipt indexes: roughly 900 MB
- Messages and other state: remainder
The largest project histories are:
- 466 threads, about 421 MB of event JSON
- 83 threads, about 158 MB
- 75 threads, about 131 MB
- 25 threads, about 81 MB
- 68 threads, about 81 MB
There is no single wildly oversized conversation—the largest individual thread is only about 13 MB. This is broad accumulation from substantial T3 usage since March. That makes it understandable, but 3.78 GB is still excessive application state and T3 appears to lack effective retention/compaction.
Archiving conversations will probably not shrink this file: the database reports no free pages, and T3’s event-sourced history remains stored. I would not manually delete database rows or run VACUUM; cleanup needs to understand T3’s projections and event history.
In short: your installed services are mostly normal. The stale blank draft and the enormous T3 event database are the genuinely unusual items and are much more relevant to the disconnect problem.
If it helps, I think this is connected to long-running tasks. Each time I run longer fix, especially with the models like 5.6 sol that returns a bunch of tool calls, t3code enters Reconnecting state until that batch of tool calls finishes.
Another annoying effect is that sometimes I am in the middle of writing followup message when this resync box appears and this blocks the input entirely. So I need to wait for it to reconnect (usually after all the tools and work is done in current thread) and only then I can continue writing.
hitting this on one of my 2 machines (lower spec corporate laptop) and it's frustrating. I'm not connecting to anything remotely, it just seems to struggle to keep connected to backend. tried 0.28 and the nightly.
really frustrating having the textbox disable and not being able to add projects.
I am pushing the memory limits on this machine, so might be related to resource exhaustion.
In case it helps, seem to be able to go to the "Providers" tab and then manually hit the refresh button, to recover connection, usually it says "last checked 1m" ago or equivalent.
My previous message regarding AlwaysOnTop, seems to work in a multi-screen setup, where when I have the application running in its own window "always on top" in its own screen, I don't get the disconnections as frequently or for as long
Adding Windows trace evidence from a reconnect investigation. This did not turn out to be the root cause of my separate iPhone/Tailscale reconnect loop (that was a stale Tailscale Serve target), but it appears relevant to this foreground health-check issue.
Environment:
- Windows 11
- T3 Code
0.0.28 - Local backend healthy on
0.0.0.0:3773 /.well-known/t3/environmentconsistently returned200
Recent
server.trace.ndjsonentries showed:ProcessDiagnosticsQueryTimeoutError: Process diagnostics query 'powershell.exe' timed out after 1000msThe same trace contained:
ws.rpc.server.getConfig durationMs=1862.1865 exit=SuccessThe logs were also rotating very quickly (several approximately 10 MB
server.trace.ndjson.*files generated within minutes), with manyshell.isExecutableFilespans during configuration/editor discovery.This supports the issue's hypothesis that
serverGetConfig({})is doing work that is too broad for a liveness probe. It can remain functionally successful while process diagnostics and executable/PATH discovery introduce latency and heavy trace volume. On a slower or busier Windows host, that same path could plausibly cross the 15-second foreground probe timeout.Potentially useful separation for maintainers:
- Use a minimal liveness RPC that does not run process diagnostics, editor discovery, VCS refresh, or PATH/executable scanning.
- Keep
server.getConfigas configuration hydration rather than connection health. - Avoid transitioning to reconnecting after one slow probe while the WebSocket is still open.
- Coalesce foreground probes and preserve composer input while health is uncertain.
I also reduced the local
PATHfor one launch to exclude stale/slow entries; configuration calls improved somewhat, but that is only a diagnostic workaround and not a complete fix for the underlying health-check coupling.juliusmarminge closed this
Sign in to join this conversation.
Correction after checking timestamps more tightly.
The reconnect happened around 2026-06-25 13:05 local time.
In
server.trace.ndjson*, I did not find a slowserver.getConfigspan exactly in the 13:04:30-13:06:30 window.The only matching server-side span I found around that time was:
2026-06-25 13:05:43 +02:00 ws.rpc.previewAutomation.connect durationMs=787773.99 exit=Interrupted cause=ClientAbort / All fibers interrupted without error
So the
KLB did not respond to a connection health checkmessage may only be visible in the client/UI state and not persisted directly in server logs.