diff --git a/docs/superpowers/plans/2026-08-14-usage-stats-gpu-combos.md b/docs/superpowers/plans/2026-08-14-usage-stats-gpu-combos.md index 69d6577..5f5f754 100644 --- a/docs/superpowers/plans/2026-08-14-usage-stats-gpu-combos.md +++ b/docs/superpowers/plans/2026-08-14-usage-stats-gpu-combos.md @@ -798,9 +798,16 @@ type InflightSettings = CfgSettings & { state.unwatchStats = undefined; ``` -5. In `onDidReceiveSettings`, after `state.settings = ev.payload.settings;`, add re-registration: +5. In `onDidReceiveSettings`, the re-registration must come AFTER + `runtime.ensureConnections(...)` (config changes recreate the + `StatsCache`, so registering earlier would land on the stale cache). + Change the tail of the method to: ```ts + state.settings = ev.payload.settings; + state.action = ev.action; + state.history = []; + runtime.ensureConnections(cfgFromSettings(state.settings)); state.unwatchStats?.(); state.unwatchStats = undefined; if (this.displayOf(state) === "usage") { @@ -808,6 +815,7 @@ type InflightSettings = CfgSettings & { } else if (!state.sampler) { state.sampler = setInterval(() => this.sample(state), 1000); } + this.render(state); ``` 6. Replace `render` with a mode-switching version and add helpers: