Skip to content

fix(tui): bound external disk refresh scans#625

Open
BatalloLu wants to merge 1 commit into
Lingtai-AI:mainfrom
BatalloLu:repairman/tui-external-disk-lag-20260711
Open

fix(tui): bound external disk refresh scans#625
BatalloLu wants to merge 1 commit into
Lingtai-AI:mainfrom
BatalloLu:repairman/tui-external-disk-lag-20260711

Conversation

@BatalloLu

Copy link
Copy Markdown
Contributor

Summary

  • Budget MailCache.Refresh() sent-history scans while preserving immediate pending sent-ID delivery checks.
  • Make inventory/list status scans more external-disk friendly: read .agent.json once, record slow_fields, and cap MCP identity scans with a truncation marker.
  • Guard props/session/detail refresh paths so auto-refresh/Ctrl+R/Ctrl+D do not stack overlapping external-disk scans; detail loads asynchronously and the footer surfaces loading/stale/slow markers.
  • Add focused tests for MailCache sent-scan throttling, inventory slow/truncated markers, and props in-flight/detail behavior.

Context

This PR targets TUI lag observed on large .lingtai networks mounted on an external disk. It does not claim to eliminate every possible exFAT/external-volume slowdown, but it removes several every-second full-scan and synchronous-detail paths that matched the observed bottlenecks.

Validation

  • git diff --check
  • go test ./internal/fs ./internal/inventory -count=1
  • go test ./internal/tui -run 'TestProps(CtrlR|CtrlD|ReloadStatusHint|AutoReloadCmd|LoadDetail)|TestAppAutoRefresh(SkipsPropsLoadWhenInFlight|TickKeepsKanbanDetailLive|TickReloadsAndRearms)|TestAutoRefreshActiveViewOnlyReloadsKanban' -count=1
  • go test ./internal/tui -run '^$' -count=1 (compile-only)

Not covered / follow-up

  • Full go test ./... was intentionally not run because existing OAuth tests may open a real browser.
  • No live external-disk Wenda validation was performed in this PR.
  • No installed binary, hotpatch, release, installed wheel/venv, or Wenda runtime/mailbox/SCU/P0 state was changed.

Throttle MailCache sent-history scans, surface slow inventory fields with bounded MCP identity reads, and guard props/detail refreshes against overlapping external-disk scans. Add focused tests for the refreshed behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant