Skip to content

SYSTEM_PROMPT instructs the LLM to call 'query_multimodal_ai' but the registered tool is 'query_multimodal_api' #165

Description

@ThatMattCat

Severity: Low · Area: Lens: contracts · Category: contract-drift
Location: services/agent/selene_agent/utils/config.py:198

What's wrong

The agent system prompt says camera snapshot URLs 'will often need to be sent for analysis using "query_multimodal_ai"', but mcp_general_tools/mcp_server.py registers the tool as name="query_multimodal_api" (line 98; the Python method is query_multimodal_ai, the exposed MCP name is _api). The prompt names a tool that does not exist in the tool list handed to the model.

How it fails

The model follows the prompt literally and emits a tool call named query_multimodal_ai after a camera-snapshot tool; the call fails with 'unknown tool', costing an extra correction iteration per turn (or a failed vision analysis on models that don't retry), particularly on smaller local models that trust prompt text over the tool schema list.

Suggested fix

Change the prompt text to query_multimodal_api (or rename the registered tool to match).

Adversarial verification — both skeptics confirmed

Skeptic 1 (confirmed) — Verified, not refuted. config.py:198 quotes "query_multimodal_ai" in SYSTEM_PROMPT, but mcp_general_tools/mcp_server.py:98 registers the tool as "query_multimodal_api" (Python method query_multimodal_ai at line 563, dispatched via the _api name at lines 220-221). No tool named query_multimodal_ai exists anywhere; all other code (tool_gat…

Skeptic 2 (confirmed) — Confirmed. SYSTEM_PROMPT at services/agent/selene_agent/utils/config.py:198 names "query_multimodal_ai", but the MCP tool is registered as name="query_multimodal_api" (mcp_general_tools/mcp_server.py:98; dispatch at 220-221 calls the Python method query_multimodal_ai — exactly the _ai/_api split the finding describes). Every other refere…


Filed from a multi-agent audit of 855f5cc: 16 reviewers over ~42k lines produced 170 raw findings; each was handed to 2 independent agents prompted to refute it, and only findings both confirmed were kept (19 refuted, 10 split-verdict, 127 unique confirmed). Line numbers are 1-indexed against 855f5cc and will drift as the code changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:lens-contractsReview area: Lens: contractsauditFound by the 855f5cc multi-agent code auditcategory:contract-driftFinding category: contract-driftseverity:lowDead code or worthwhile improvement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions