Skip to content

Commit 09cb35d

Browse files
chernistryclaude
andcommitted
fix: resolve Pyright strict type errors in retro widget data flow
Use explicit cast and typed dict construction instead of dict comprehension over list[Any] to satisfy reportUnknownVariableType. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d72db4c commit 09cb35d

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/bernstein/tui/app.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,13 @@ def action_refresh(self) -> None:
283283
scope = self.query_one("#oscilloscope", OscilloscopeWidget)
284284
if scope.display:
285285
scope.update_agents(agents_data)
286-
samples = {
287-
a.get("session_id", ""): a.get("tokens_per_sec", 0.0)
288-
for a in agents_data
289-
if isinstance(a, dict) and a.get("session_id")
290-
}
286+
samples: dict[str, float] = {}
287+
for a in agents_data:
288+
if isinstance(a, dict):
289+
agent = cast("dict[str, Any]", a)
290+
sid = agent.get("session_id", "")
291+
if sid:
292+
samples[str(sid)] = float(agent.get("tokens_per_sec", 0.0))
291293
if samples:
292294
scope.add_samples(samples)
293295

0 commit comments

Comments
 (0)