# fix\(web\): clear stale resource monitor errors after retry · PR \#24229 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/24229)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: merged

Source repository: pingdotgg/t3code

Source branch: takeover/pr-23970

Target branch: main

Head commit: 0b0e5e2715c6aa46246abe43d1e6e5ca6f7d0fd5

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/24229)

[Commits](https://git.cafe/pingdotgg/t3code/pull/24229/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/24229/diffs?format=markdown)

## Description

---

## Problem

- After a failed resource monitor start, clicking Retry succeeds but the settings panel keeps showing the old error until the page is reloaded.

## Change

- Refresh the telemetry query after a successful retry, and refresh the history in the diagnostics panel, so the stale error clears.

## Scope and approval

- Small, focused fix of an obvious bug in retry state; no new capability or setting.

## Verification

- Added `resourceTelemetryState.browser.test.tsx`: after a successful retry, the hook's error clears. It fails without the change (`expected 'The resource monitor is not available.' to be null`) and passes with it.
- Format, lint, knip, and typecheck pass for the affected packages.
- Not exercised in a running client.

## Takeover

Keeps @yordis's original commit from [#23970](https://github.com/pingdotgg/t3code/pull/23970) and its two query refreshes.
Replaced the mocked regression with rendered query-cache coverage; added an environment-guarded refresh for a history window selected while Retry is pending, after running-client evidence exposed that stale error.
This origin branch replaces the non-pushable fork branch. The dispatcher owns closing the original and merging.

## Evidence

Synthetic faults at the real server RPC boundary; real web UI, authentication, schemas, transport, query cache, and navigation. This proves client recovery, not native collector startup.
[Full matrix](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/17faee58aee64a65/complete-matrix.md) · [captures, both diff variants, recordings, manifests, and rebuild recipe](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/27c4e529e690ab53/index.md).

| Fixture | Proof |
|---|---|
| S0 diagnostics closed | Fixed synthetic workspace; light/dark, 1440/390 |
| S1 failed start | Distinct telemetry and history errors |
| S2 Retry pending | Explicit latch, disabled Retry, errors retained |
| S3 empty recovery | Both errors clear after success |
| S4 populated recovery | Metrics, history, process tree, and I/O recover |
| S5 Retry rejected | Errors retained; Retry available |
| S6 unavailable with retained data | Real successful reads transition to failures |
| S7 healthy control | Stable fixture; 25 icon pixels below threshold 16 disclosed |
| S8 diagnostics unavailable | Restricted connection omits panel |
| R1 recovery recording | Same document; before errors persist, after clear |
| R2 failure then success | Rejection toast, second Retry, visible recovered history |
| R3 history window switch | Selected 5m and originating 15m both recover |
| R4 environment switch | A Retry completes without changing B; focus away/back |
| R5 close/reopen | In-app navigation while pending; healthy reopen |

All still rows: before/after at 1440×1000 and 390×844, light/dark; 300 identical settling pairs, semantic crops and both zero×8/threshold16 diffs. Thirteen canonical narrated recordings; historical failed proof is explicitly marked.

Before:
![Before: successful Retry leaves the stale resource error](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/e3089a1dde2daf8a/before-monitor.png)

After:
![After: successful Retry clears the resource error](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/7f884e83688fd109/after-monitor.png)

[Before recording](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/4c46cfacc165562a/R1-before-1440-light.mp4) · [After recording](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/894eaa5e5f7763e6/R1-after-1440-light.mp4)

<details><summary>Verification log</summary>

[Final proof audit: SUFFICIENT](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/ea9116305f782479/audit-report.md); all S0–S8/R1–R5 objections resolved; independent fresh-home recovery reproduced.
Final head: 5 tests passed across the browser regression and existing diagnostics logic file; targeted lint, formatting, web typecheck and diff checks passed. Regression removals reproduced the original and selected-window failures.
Code review round 1: A+B MERGE. Running-client proof then exposed the window-switch case; fixed and reviewed again in round 2: A+B MERGE.
CI: pending on the replacement head; monitored through T3 Code.
Required changed surface: web. Responsive 390px is web; native collector startup, Electron shell, and native mobile were not exercised.
No provider, contract, persistence, auth, permission, or MCP behavior changed. Contributor commit remains in ancestry; no fork write, force push, rebase, or merge of a PR.
Model and harness: gpt-6.1-sol via Codex in T3 Code, including every delegated step.

</details>


