Skip to content

HostSpark v0.4.4

Choose a tag to compare

@gemini960114 gemini960114 released this 04 Sep 02:28
· 1 commit to main since this release

What's Changed in HostSpark v0.4.4

A dedicated user experience (UX) and stability release introducing live heartbeat elapsed timers, one-click /cancel self-rescue hints, stall warning detection for slow subcommands, nested coroutine variable scope fixes, and anti-blocking timeout optimizations.


⚡ Live Dynamic Heartbeat Elapsed Timer & Zero-Freeze UX

  • Real-Time Heartbeat Timer: Status messages in Telegram now actively refresh with an elapsed time counter (⏳ 國網AI助理 正在思考與執行中,請稍候... (已耗時 14s)).
  • Eliminates Screen Freezing: Even if an underlying tool or subcommand takes time or produces no intermediate output, the timer ticks every ~3–4 seconds, reassuring users that the session is alive and actively progressing.
  • Auto-Elapsed in Progress Updates: When new streaming output or tool execution reports arrive, the elapsed time is smoothly preserved and shown alongside current tool status.

🛡️ One-Click Emergency /cancel Self-Rescue

  • Clickable Status Card Hint: Added 👉 可點擊 /cancel 隨時中斷任務 directly to the live progress card.
  • Instant Abort: Users can simply tap the command link on mobile or desktop to cancel runaway or stuck tasks immediately without having to recall or manually type slash commands.

⚠️ Stall Warning Detection (>30s)

  • Proactive Stall Alerts: If a subcommand runs for over 30 seconds without generating stdout/stderr (e.g. streaming log readers, heavy compilation, or network waits), the status message automatically displays:
    ⚠️ 底層指令執行中,已超過 35s 未有新輸出...
  • Keeps users informed about long-running operations before any timeout triggers.

🐛 Bug Fix: keep_typing Coroutine Scope Fix

  • Fixed UnboundLocalError: Added nonlocal last_edit_time to the nested keep_typing() coroutine inside src/hostspark/telegram/dispatcher.py.
  • Previously, assigning to last_edit_time within the inner coroutine without nonlocal caused Python to treat it as an unbound local variable, silently terminating the typing heartbeat loop.

⏱️ Timeout & Anti-Blocking Prompt Optimizations

  • Optimized Default Timeout: Adjusted default AGY_TIMEOUT_SECONDS from 600s (10 minutes) to 180s (3 minutes) in .env.example and documentation, preventing excessive waiting periods if a task stalls.
  • Anti-Blocking Rule Prompt: Updated prompt recommendations in .env.example advising the assistant to:
    1. Never read continuous stdout streams without finite limits (e.g. head /var/log/apache2/access.log in Docker containers whose stdout pipes never reach EOF). Always use docker logs --tail N or strict timeouts (timeout 5s ...).
    2. Background daemon processes immediately.

📖 Documentation Updates

  • Updated README.md and README.zh-TW.md to detail:
    • Active heartbeat timer and stall warnings in feature highlights.
    • /cancel progress card integration.
    • Default AGY_TIMEOUT_SECONDS=180.

📦 Upgrade Notes

To upgrade an existing HostSpark installation to v0.4.4:

git pull origin main
sudo systemctl restart agy-telegram.service