New HUD system for Wingman AI with independent HUD server and new HUD skill utilizing it.#343
Conversation
b0f535c to
fabf1c4
Compare
|
Aww, bummer this only works on Windows. We have other places in the code already where we check the OS and disable/skip certain features when not on Windows. Please do this for HUD, too. Check the OS very early in the chain and skip everything if not running on Windows. I'd expect no traces, server instances or initialized variables at all when running on MacOS. I'll make sure to hide everything HUD related in the MacOS UI, too. Please be very defensive with this, especially where HUD plugs into Core. Always expect it not to be available and initialized at all. |
|
Rendering the HUD is OS-level stuff. |
e224ea9 to
60363f8
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a comprehensive HUD (Heads-Up Display) server system to Wingman AI, providing HTTP-based control of transparent overlay windows for displaying messages, progress bars, chat, and persistent information. The implementation includes a FastAPI server, PIL-based overlay renderer (Windows only), layout management system, and both async/sync HTTP clients.
Changes:
- Full HUD server module with HTTP API, state management, and rendering pipeline
- Integration into wingman_core.py with lifecycle management and settings reactivity
- HUD skill for controlling overlays from LLM tool calls
- Configuration system with validation and runtime updates
- Comprehensive test suite with visual and stress tests
Reviewed changes
Copilot reviewed 39 out of 42 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| wingman_core.py | Added HUD server lifecycle management, settings subscription, and platform check |
| wingmen/open_ai_wingman.py | Simplified tool response update logic (potential bug) |
| templates/configs/settings.yaml | Added hud_server configuration section |
| services/settings_service.py | Added hud_server settings event publishing |
| services/mcp_client.py | Enhanced SSE connection resilience with auto-reconnect |
| services/migrations/migration_200_to_210.py | Added hud_server settings migration |
| api/interface.py | Added HudServerSettings model to API interface |
| hud_server/* | Complete new module with server, client, renderer, layout manager |
| skills/hud/* | New HUD skill for overlay control |
- Remove excessive debug logging from `hud_server`, `hud_manager`, and `skills/hud` to reduce console noise. - Replace `sys.stderr.write` with `_report_exception` in `overlay.py` for consistent error handling. - Reduce log noise for 404 errors in `hud_server` exception handler. - Clean up exception handling in `http_client` to suppress unnecessary retry logs.
…tion - Create `hud_server/constants.py` to centralize configuration, timeouts, limits, and API paths. - Update `HudServer` and `HudHttpClient` to utilize centralized constants for consistent behavior. - Enhance `HudHttpClientSync` with improved thread safety, locking, and event loop management during startup. - Add Pydantic field validation, constraints, and default values in `hud_server/models.py`. - Consolidate documentation into `hud_server/README.md` and `hud_server/API.md`, removing scattered README files. - Improve logging and error handling during server and overlay lifecycle events.
…ated documentation
…channel support (#10) * Initial plan * Implement render caching for HUD performance optimization Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> * Address code review feedback for HUD caching Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> * Mark deprecated legacy methods in overlay.py, document unified window system Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> * Add deprecation warnings to legacy methods in overlay.py Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> * Improve deprecated methods documentation clarity Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> * Optimize HUD rendering by removing redundant z-order updates for windows * Remove legacy HUD code and fix cache issues causing ghosting Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> * Add docstring to _init_fonts and complete code review Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> * Fix layout manager releasing slot before fade-out completes Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> * Refactor chat window handling and improve HUD rendering performance * Remove unused legacy chat window code and fix chat window integration Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> * Enhance Snake game with gradient snake body, combo system, and golden apples * Enable alpha channel support in HUD background colors Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> * Address code review feedback for alpha channel support Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> * Add emoji support and scroll fade effect to chat overlay rendering --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> Co-authored-by: Jan Winkler <jan@jmwinkler.de>
* Initial plan * Append consecutive same-sender chat messages instead of creating new entries When a message is added to a chat window from the same sender as the last message, the text is appended to the last message (separated by a space) instead of creating a new message entry with a repeated sender name. Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> * Update chat tests for same-sender message merging behavior - test_chat_markdown: alternate senders so each markdown feature renders separately - test_chat_auto_hide: use different sender for second message to prevent merging - test_chat_overflow: unique sender per message to prevent merging during overflow test - Add test_chat_message_merging: dedicated test for consecutive same-sender merging Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com>
* Initial plan * Add chat message update feature with message IDs - Add `id` field (UUID) to ChatMessage dataclass - Change send_chat_message to return message ID (or merged message's ID) - Add update_chat_message method to HudManager - Add ChatMessageResponse and ChatMessageUpdateRequest models - Add PUT /chat/message endpoint for updating messages by ID - Update POST /chat/message to return message_id in response - Update HTTP client (async + sync) with update_chat_message method - Update TestSession with update_chat_message helper - Update overlay handler to track message IDs and handle updates - Update state serialization/deserialization to include message IDs - Add test_chat_message_update test case - Update README documentation with message update API Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> * Address code review: keep sender/text required in ChatMessage, fix comment Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com>
* Initial plan * Use reactive WinEvent hook for HUD foreground management instead of polling Replace the removed polling loop with an event-driven approach using SetWinEventHook(EVENT_SYSTEM_FOREGROUND). The callback sets a thread-safe threading.Event flag, and the main render loop checks/clears it each frame, re-applying HWND_TOPMOST only when a foreground change is actually detected. This is both more performant (zero cost when no changes occur) and more responsive (reacts instantly to foreground changes) than the old 50ms poll. Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> * Add log line when HUD foreground change is detected and repositioned Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: SawPsyder <44277746+SawPsyder@users.noreply.github.com>
…t family and font size rendering
…s for xvasynth and pocket TTS
… classes for improved clarity and maintainability
…ry with dummy tool responses. It was actually able to cause problems/corrupted message history under certain circumstances (like user calls during ongoing tool responses)
…y and consistency
…- even during fade transitions
…argin, spacing, and screen selection
…uration management
…ttings update functionality for hud server
…econnection attempts
78129af to
a12ef41
Compare
This completely adds the HUD http server, the HUD renderer and HUD skill to Wingman AI as full core integrations.
This is marked as draft as it still needs several polish runs.
But the functionality is at 95% now - only missing HUD hide/show tools & HUD server start/stop as system setting change reaction.
TODO list: