mirror of
https://github.com/open-jarvis/OpenJarvis.git
synced 2026-07-29 18:40:38 +00:00
Follow-up on @TX-Huang's PR #294. The default-agent fallback now routes `jarvis ask "..."` (no --agent) through `config.agent.default_agent`, which dataclass-defaults to `"simple"`. The autouse `_clean_registries` fixture in tests/conftest.py clears AgentRegistry between tests, so the fallback then fails with `Unknown agent: simple` and every CLI-driven test_energy_wiring test exits with code 1. These tests exercise engine-level instrumentation, not agent dispatch — ``test_engine_wrapped_with_instrumented``, the energy-monitor lifecycle tests, and the end-to-end pipeline tests all care that the engine gets wrapped and telemetry lands in SQLite, regardless of whether the call goes through an agent. Set ``cfg.agent.default_agent = ""`` in ``_energy_config`` to keep these tests on the direct-engine path they were originally designed for. The dedicated ``test_agent_mode_uses_instrumented_engine`` (which explicitly passes ``--agent``) is unaffected. Same pattern PR #294 already uses in tests/cli/test_ask_router.py for the two MagicMock-config tests. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>