Skip to content

Stale test: TestExecuteTool.test_dispatches_compute references removed 'compute' tool #79

@vahid-ahmadi

Description

@vahid-ahmadi

Symptom

backend/tests/test_agent_tools.py:322 references a compute tool that no longer exists:

def test_dispatches_compute(self):
    result = execute_tool("compute", {"operation": "sum", "data": [1, 2, 3]})
    assert result["result"] == 6

When run, this test fails with a KeyError: 'result'execute_tool returns {"error": "Unknown tool: compute"} for any tool not in its dispatch dict (backend/agent_tools.py:690), and the dispatch dict has never contained "compute" on main.

History

The compute tool was rewritten to run_python in PR #11 — see the context in commit 249f9c8 ("Register the three dormant typed tools (UK)"):

Re-exposes calculate_household, run_economy_simulation, and analyse_microdata to the LLM via get_tool_definitions(). These functions have existed since the early agent_tools.py but were quietly removed from the registry in PR #11 (compute → run_python rewrite) — no documented rationale.

This test wasn't deleted at the time and has been silently failing (or skipped, depending on the CI config) since then.

Fix

Delete test_dispatches_compute (one method, ~3 lines). The compute tool isn't coming back — its behaviour is covered by run_python which has its own tests.

If anyone has a reason to keep compute as a real tool (e.g. typed-arg version of common ops), that's a separate design discussion — open a fresh issue for it.

Discovered while reviewing #78

Noticed by the agent wiring up generate_chart as a real tool (#78), which added a healthy test_dispatches_generate_chart right next to the broken test_dispatches_compute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions