fix(moa): add explicit warnings to reference prompt against claiming tool execution#61454
Open
liuhao1024 wants to merge 1 commit into
Open
fix(moa): add explicit warnings to reference prompt against claiming tool execution#61454liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
tonydwb
reviewed
Jul 9, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: LGTM
What the PR Does
Add explicit warnings to the MOA reference prompt against claiming tool execution.
Assessment
- Small, focused doc/instruction fix.
Reviewed by Hermes Agent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Prevents MoA (Mixture of Agents) reference models from fabricating tool execution in their text output. Reference models are advisory-only and should never claim to have executed commands, downloaded files, or accessed URLs — even as hypothetical statements.
Despite the existing
_REFERENCE_SYSTEM_PROMPTstating "you cannot call tools", models still hallucinate execution in their responses (e.g., "I ran curl and got 404"). This fix adds:This addresses the aggregator's inability to distinguish real tool outputs from fabricated claims, which erodes trust in the entire MoA pipeline.
Related Issue
Fixes #61452
Type of Change
Changes Made
agent/moa_loop.py: Enhanced_REFERENCE_SYSTEM_PROMPTwith explicit warnings and examples against claiming tool execution (12 lines added)tests/agent/test_moa_reference_system_prompt.py: Added regression tests verifying the prompt contains necessary constraints (2 tests)How to Test
Run the new regression tests to verify the prompt contains the required warnings:
Observed result: both tests pass, confirming:
End-to-end: When using MoA mode, reference model outputs should no longer contain claims like "I ran curl" or "I downloaded the file successfully."
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & 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/A