Skip to content

Comments

fix(person-follow): fix session leak, tracking spam, and double hook on startup#2407

Open
Wanbogang wants to merge 3 commits intoOpenMind:mainfrom
Wanbogang:fix/person-follow-mode-bugs
Open

fix(person-follow): fix session leak, tracking spam, and double hook on startup#2407
Wanbogang wants to merge 3 commits intoOpenMind:mainfrom
Wanbogang:fix/person-follow-mode-bugs

Conversation

@Wanbogang
Copy link
Collaborator

Summary

#1592

Bug 1 & 2 invalid
Fixes 3 bugs found in person_follow mode affecting stability and LLM token usage.

Changes

Bug 3 — Duplicate lifecycle hook on startup

  • Removed start_person_follow_hook from on_startup in config/unitree_go2_modes.json5
  • Hook is now only registered under on_entry
  • Prevents double enrollment announcement when mode_memory_enabled restores person_follow state on boot

Bug 4 — aiohttp.ClientSession created on every poll

  • Added _session instance variable to reuse a single ClientSession across all poll cycles
  • Session is recreated automatically if closed
  • Prevents socket exhaustion and TCP handshake overhead at 2 polls/second

Bug 5 — TRACKING status messages spammed to LLM

  • Added _last_tracking_report throttle — TRACKING updates sent at most every 10 seconds
  • State-change events (TRACKING STARTED, SEARCHING, WAITING) bypass throttle and are always sent immediately
  • Reduces LLM token usage by ~90% during active tracking

@Wanbogang Wanbogang requested review from a team as code owners February 22, 2026 02:50
@github-actions github-actions bot added robotics Robotics code changes python Python code tests Test files config Configuration files labels Feb 22, 2026
@codecov
Copy link

codecov bot commented Feb 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration files python Python code robotics Robotics code changes tests Test files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant