Skip to content

Comments

fix: periodic tick for TUI metrics refresh#453

Merged
bug-ops merged 1 commit intomainfrom
feat/m27/tui-metrics-refresh
Feb 17, 2026
Merged

fix: periodic tick for TUI metrics refresh#453
bug-ops merged 1 commit intomainfrom
feat/m27/tui-metrics-refresh

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 17, 2026

Summary

  • Add 250ms interval tick to tui_loop select! to ensure metrics polling and screen redraw regardless of user/agent event activity
  • Fixes stale Context/Session/Resources display in TUI dashboard

Root cause

The event loop blocked indefinitely in tokio::select! on UI and agent channels. Without incoming events, poll_metrics() and terminal.draw() never re-executed, leaving metrics frozen at their initial values.

Test plan

  • Run cargo run -- --tui, observe Resources panel updates during LLM calls
  • Verify no CPU overhead from idle tick (250ms = ~4 Hz)

Closes #447

The TUI event loop blocked on tokio::select! waiting for user input
or agent events. When the agent was processing (updating metrics via
watch channel), the loop never woke up to poll and redraw, causing
stale metrics display.

Add a 250ms interval tick branch to select! so metrics are polled
and the screen redraws at ~4 Hz regardless of event activity.

Closes #447
@github-actions github-actions bot added rust bug Something isn't working size/XS labels Feb 17, 2026
@bug-ops bug-ops enabled auto-merge (squash) February 17, 2026 15:13
@bug-ops bug-ops merged commit a8f1fd6 into main Feb 17, 2026
18 checks passed
@bug-ops bug-ops deleted the feat/m27/tui-metrics-refresh branch February 17, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working rust size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI: resources/context/session metrics not updating after initial load

1 participant