Skip to content

Discard follow-up responses containing capability denials#176

Merged
rockfordlhotka merged 1 commit intomainfrom
fix/follow-up-denial-guard
Mar 20, 2026
Merged

Discard follow-up responses containing capability denials#176
rockfordlhotka merged 1 commit intomainfrom
fix/follow-up-denial-guard

Conversation

@rockfordlhotka
Copy link
Member

Summary

The model sometimes hallucinates that tools like mcp_invoke_tool or mcp_get_service_details don't exist — even when they're right there in the 40-tool list. When this happens on a follow-up pass, the false denial gets appended to an otherwise good response.

Now checks the follow-up result against CapabilityDenialRegex and silently discards it rather than showing the user misinformation like "the runtime does not expose mcp_get_service_details."

Test plan

  • dotnet build RockBot.slnx — zero errors
  • dotnet test RockBot.slnx — all tests pass

🤖 Generated with Claude Code

The model sometimes claims tools like mcp_invoke_tool or
mcp_get_service_details don't exist — even when they're in the tool
list — producing false denial text in follow-up passes. Now checks the
follow-up result against CapabilityDenialRegex and discards it rather
than appending misinformation to the user's response.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rockfordlhotka rockfordlhotka merged commit 41e549d into main Mar 20, 2026
1 check passed
@rockfordlhotka rockfordlhotka deleted the fix/follow-up-denial-guard branch March 20, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant