fix(tests): stabilize main full-suite baseline - #27440
Conversation
4397bca to
a369cb9
Compare
a369cb9 to
ce20c7a
Compare
There was a problem hiding this comment.
Pull request overview
This PR focuses on eliminating full-suite baseline failures (notably on macOS) by hardening test isolation/collection behavior (especially around Discord/Telegram stubs), making a few runtime paths more resilient to missing OS utilities, and tightening some gateway/web/kanban edge cases that were sensitive to environment state.
Changes:
- Normalize Discord/Telegram/Google Chat test doubles and cache invalidation to avoid xdist collection-order leakage and stale availability checks.
- Make several runtime/utilities more resilient (e.g., auxiliary client timeout cleanup, systemctl/timeout presence, dynamic env lookup for xAI helpers).
- Improve Kanban dashboard UX/API behavior by surfacing actionable 409 dependency-block details and displaying parsed API error messages in the UI.
Reviewed changes
Copilot reviewed 40 out of 42 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds dev dependencies (FastAPI/Uvicorn) and composes dev to include web extra in the lock. |
| tui_gateway/server.py | Refines browser connect failure messaging by checking Chrome candidate availability. |
| tools/xai_http.py | Switches xAI env lookup to dynamically resolve Hermes config helper at call time. |
| tests/tools/test_terminal_tool_requirements.py | Clears both tool-definition and check-fn caches to avoid stale tool availability across tests. |
| tests/hermes_cli/test_web_server.py | Skips PTY websocket tests when optional ptyprocess isn’t installed. |
| tests/hermes_cli/test_tools_config.py | Uses _visible_providers() to select providers consistent with runtime visibility rules. |
| tests/hermes_cli/test_model_switch_custom_providers.py | Adds stub for fetch_api_models to keep provider listing tests hermetic. |
| tests/hermes_cli/test_gateway_wsl.py | Stubs shutil.which("systemctl") to stabilize systemd capability tests. |
| tests/hermes_cli/test_api_key_providers.py | Hardens auto provider resolution test by clearing env and patching auth/AWS credential probes. |
| tests/gateway/test_voice_command.py | Adjusts Discord module detection; updates expected Telegram DM metadata. |
| tests/gateway/test_telegram_thread_fallback.py | Updates expected Telegram DM metadata in busy-ack path. |
| tests/gateway/test_send_multiple_images.py | Adjusts Discord module detection to distinguish real installs vs mocks. |
| tests/gateway/test_send_image_file.py | Adjusts Discord module detection to distinguish real installs vs mocks. |
| tests/gateway/test_google_chat.py | Ensures service_account stub exists when google-auth isn’t installed. |
| tests/gateway/test_discord_slash_commands.py | Adjusts Discord module detection to prevent mock leakage across files. |
| tests/gateway/test_discord_slash_auth.py | Adjusts Discord module detection to prevent mock leakage across files. |
| tests/gateway/test_discord_send.py | Adjusts Discord module detection to prevent mock leakage across files. |
| tests/gateway/test_discord_reply_mode.py | Adjusts Discord module detection to prevent mock leakage across files. |
| tests/gateway/test_discord_reactions.py | Adjusts Discord module detection to prevent mock leakage across files. |
| tests/gateway/test_discord_free_response.py | Adjusts Discord module detection to prevent mock leakage across files. |
| tests/gateway/test_discord_document_handling.py | Adjusts Discord module detection to prevent mock leakage across files. |
| tests/gateway/test_discord_connect.py | Adjusts Discord module detection and keeps AllowedMentions stable across import order. |
| tests/gateway/test_discord_channel_prompts.py | Adjusts Discord module detection to prevent mock leakage across files. |
| tests/gateway/test_discord_channel_controls.py | Adjusts Discord module detection to prevent mock leakage across files. |
| tests/gateway/test_discord_attachment_download.py | Adjusts Discord module detection to prevent mock leakage across files. |
| tests/gateway/test_discord_allowed_mentions.py | Adjusts Discord module detection and keeps AllowedMentions stable across import order. |
| tests/gateway/test_background_command.py | Updates expected Telegram DM metadata for background completion. |
| tests/gateway/conftest.py | Centralizes stronger Telegram/Discord mocks and patches already-imported gateway modules for stability. |
| tests/e2e/conftest.py | Expands Discord mock surface area and avoids setdefault leakage by explicitly overwriting sys.modules entries. |
| tests/conftest.py | Improves guard behavior around subprocess calls (incl. systemctl-missing behavior) and adds annotations for Windows footguns. |
| tests/agent/test_bedrock_integration.py | Stabilizes bedrock region behavior by patching region resolution helper. |
| tests/agent/test_anthropic_adapter.py | Prevents macOS keychain Claude Code creds from leaking into hermetic auth tests. |
| run_agent.py | Normalizes provider casing when determining Kimi tool reasoning behavior. |
| pyproject.toml | Composes dev extra to include web extra dependencies. |
| plugins/platforms/google_chat/adapter.py | Loads google-auth modules lazily for standalone send and returns a clear error if unavailable. |
| plugins/kanban/dashboard/plugin_api.py | Adds detailed dependency-blocked 409 responses for “ready” moves and refines diagnostics severity filtering. |
| plugins/kanban/dashboard/dist/index.js | Parses API error detail from JSON-ish error strings and displays PATCH failures inline. |
| hermes_cli/main.py | Updates auxiliary-model comment to include approvals among tasks. |
| hermes_cli/gateway.py | Adds accessible-dir helper and avoids user-systemd preflight when systemctl isn’t present. |
| gateway/shutdown_forensics.py | Makes shutdown diagnostic spawn tolerant of missing timeout binary. |
| agent/auxiliary_client.py | Ensures auxiliary client close-on-timeout is idempotent and always triggered on deadline breach. |
| agent/anthropic_adapter.py | Treats TypeError as invalid JSON when decoding keychain payloads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ce20c7a to
862dec2
Compare
2f161e5 to
34f0c0a
Compare
|
@austinpickett addressed the requested changes from #27440 (review) in the latest commit
Verification after the fixes:
|
9011b87 to
19ecff4
Compare
19ecff4 to
39ae800
Compare
39ae800 to
772de21
Compare
|
Thanks for the broad stabilization work. There are still useful focused fixes here, but the current branch should be salvaged selectively rather than applied wholesale. Problems
Suggested changes
This is an automated hermes-sweeper review. |
|
Thanks @nocturnum91 — closing: this stabilization pass was superseded by the suite-wide test-stability campaign (PRs #74330/#74383/#74517/#74553); the baseline now runs 0 failed / 0 flaky and the branch conflicts across 30+ files with no surviving fix to cherry-pick. Appreciate the early push on suite health. |
What does this PR do?
Fixes macOS/full-suite baseline failures and test isolation problems that made the broad Hermes test suite order-dependent. The changes harden Discord/Telegram test doubles, gateway fixture normalization, provider/config test cleanup, and a few runtime cleanup paths that were exposed while stabilizing the suite.
Related Issue
N/A — baseline/test-suite stabilization PR.
Type of Change
Changes Made
MagicMockstubs into adapter globals.severity_at_or_above) instead of exact matching.How to Test
Verification performed during refresh:
VERDICT: CLEAN.main; conflicts were resolved and the fork branch was updated with--force-with-lease.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passNote: During refresh I ran the full local suite via the CONTRIBUTING-recommended wrapper
TMPDIR=/tmp ./scripts/run_tests.sh tests(24472 passed, 120 skipped, 231 warnings), plus focused/regression checks for the changed areas. GitHub Actions is still the source of truth for the hosted matrix.Documentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
N/A — this PR does not add a skill.
Screenshots / Logs
N/A. Relevant verification is in local focused test output, Codex review logs, and GitHub Actions checks.