test(energy_wiring): opt out of #294 default-agent fallback in _energy_config

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>
This commit is contained in:
krypticmouse
2026-05-20 03:37:09 +00:00
co-authored by Claude Opus 4.7
parent c7f451fbc8
commit 0217a901dd
+5
View File
@@ -88,6 +88,11 @@ def _energy_config(tmp_path, gpu_metrics=True):
cfg.telemetry.gpu_metrics = gpu_metrics
cfg.telemetry.energy_vendor = ""
cfg.telemetry.db_path = str(tmp_path / "telemetry.db")
# These tests exercise engine-level instrumentation, not agent dispatch.
# `jarvis ask` (no --agent) now falls back to ``agent.default_agent``
# which defaults to "simple", and conftest clears the registry per test.
# Opt out explicitly so the CLI uses direct-engine mode here.
cfg.agent.default_agent = ""
return cfg