Nitpicky updates
Thorough /new Cleanup
- Cancels all running asynchronous tasks and clears Goal Manager active goals when
/newis executed. - Synchronously cleans up
DATA_CHAT_SESSIONandDATA_CHAT_LOGSto ensure no residual old session data remains. - Removes
pending_goal_continuations,completed_goal_conversations, and pipeline continuation flags. - Resolves the issue where residual states after
/newcaused LLM token length errors that previously required a restart to recover.
Accurate Entity Name Display
- Each AI agent now displays its actual name prefix (e.g., Claw Assistant, Google Generative AI, etc.) when replying.
- Stops uniformly labeling all agents as "Claw Assistant"; names are now dynamically resolved via the entity registry.
Voice Pipeline TTS Enhancements
TTS Markdown Filtering
- Added
_clean_for_tts: Strips Markdown formatting such as bolding, code blocks, links, images, tables, headers, blockquotes, lists, and dividers. - The voice pipeline now only plays plain text, while the frontend chat window retains the original full Markdown.
- Patched the non-streaming path in
PipelineRun.text_to_speechto ensure consistent filtering.
Voice Channel System Prompt Injection
- Automatically injects prompts into the voice pipeline to guide the AI to reply in a conversational/spoken style.
- Explicitly instructs the AI that "the user is listening, not reading," and strictly forbids the output of Markdown/URLs.
- Comprehensively expanded prompts across three channels: HA Frontend, IM Bot, and Voice Pipeline.
API Call Timeout Protection & Context Restoration
120-Second Hard Timeout
- Wrapped LLM API calls in
orchestratorandturn_kernelwithasyncio.wait_for(timeout=120). - Graceful degradation after timeout: Generates a summary reply based on completed steps instead of hanging indefinitely.
Orphaned tool_call Fix (sanitize_tool_pairs)
- Added
sanitize_tool_pairs: Detects orphanedtool_calls (without a correspondingtool_result) in the chat history and automatically appends placeholder results. - Automatically executed before API calls in
agent_fallbackandturn_kernel. - Synchronously executed during context overflow retries to prevent continuous failures caused by formatting errors.
- Added
"tool_calls"and"must be followed by"as retryable error keywords inagent_fallback; automatically retries instead of failing directly when encountering orphanedtool_callerrors.
Significant Frontend Tool Enhancements
FrontendInspect Tool Refactoring
- Added
search_cacheaction: Automatically caches the full text after executingexec_json large pages, enabling precise content locating via keyword searches. - Added
press_keyaction: Supports keyboard operations like Enter, Escape, Tab, and arrow keys. - Completely rewrote tool descriptions: Clarified DOM traversal chains, collaboration workflows with the DashboardCard tool, and user intent examples.
snapshotdeep traversal optimization: Added a node count limit to prevent DOM explosion, and automatically collapses pass-through nodes.snapshotautomatic entity state extraction:entity_idbound to cards directly displays inlinestate,unit, andfriendly_name.snapshotautomatically captures the sidebar navigation list and the content of opened pop-ups/dialogs.- Leaf nodes automatically extract
innerText, eliminating the need for additionalexec_jsto read plain text content.
Pop-up/Dialog Observer
- Added
setupDialogObservertoha_crack.js: UsesMutationObserverto listen for pop-ups opening within the HA Shadow DOM. - Automatically captures pop-up titles, subtitles, form fields (including label/value/options), and button lists.
- Reports to the backend via the
ha_crack/dialog_snapshotWebSocket command, allowing AI to directly read and interact with pop-ups.
DashboardCard Tool Improvements
- Automatically triggers the
lovelace_updatedevent after saving dashboard configurations. - Uses
queue_frontend_execto achieve frontend SPA seamless (refresh-free) navigation to the modified page.
Frontend Text Cache
- Added
store_frontend_text_cache/search_frontend_text_cache: Automatically caches large amounts of text returned byexec_js. - AI can subsequently search cached content via keywords, avoiding repeated JS scraping executions.
Continuous Dialogue Switch Refresh
- When toggling the "Continuous Chat Window" setting, the backend automatically performs a complete state cleanup.
Auto-Update Detection & GitHub Proxy Acceleration
Automatic Version Detection
- Delays checking until HACS finishes loading after startup, then polls GitHub every 2 hours for new versions.
- GitHub API requests prioritize the
gh-proxy.orgproxy, automatically falling back to a direct connection upon failure. - When a new version is detected, it directly updates HACS repository metadata, triggering the update entity to display "Update available".
Search Tool Description Optimization
- WebSearch: Clearly marked as "Keyword search, not for scraping specific URLs" to guide AI in distinguishing between searching and scraping.
- UrlFetch: Emphasized that "when the user provides a clear URL/link, this tool must be used directly instead of WebSearch."
Web Scraping Improvements
web_fetcher4xx fast-fail: Directly throws an exception for HTTP 400-499 status codes, no longer pointlessly retrying non-existent pages.
Other Improvements
ha_crack.jshot update: Automatically triggerslocation.reload()when a JS version change is detected, removing the need to manually clear the cache.- **Unified frontend JS version with
const.py**:frontend_loaderno longer hardcodes the version and directly referencesVERSION. - Tool progress text optimization: "Thinking" -> "Deep reasoning in progress"; "Reading" -> "Accessing"; WebSearch now identifies URL-type queries and displays the domain name.
Full Changelog: [https://github.com/ha-china/ha_claw/compare/v7.7.0...v7.8.0]