Skip to content

fix(tool-guardrails): detect content repetition across varying argument sets (#60084) - #60148

Closed
kyssta-exe wants to merge 1 commit into
NousResearch:mainfrom
kyssta-exe:fix/auto-60084
Closed

fix(tool-guardrails): detect content repetition across varying argument sets (#60084)#60148
kyssta-exe wants to merge 1 commit into
NousResearch:mainfrom
kyssta-exe:fix/auto-60084

Conversation

@kyssta-exe

Copy link
Copy Markdown
Contributor

Add a content-hash-only repetition tracker to ToolCallGuardrailController that catches loops where tool arguments vary but the result content stays the same.

Two loop shapes detected:

  1. Varying-args / fixed-result: a tool returning the same blocked/error-page body with different arguments on every call.
  2. Repeated multimodal results: vision/vision tools with unique base64 payloads but identical meaningful captions.

New config options:

  • same_content_warn_after: 3 (default)
  • same_content_block_after: 6 (default, requires hard_stop_enabled)

Closes #60084

…nt sets (NousResearch#60084)

Add a content-hash-only repetition tracker to ToolCallGuardrailController
that catches loops where tool arguments vary but the result content stays
the same — two loop shapes the existing signature-keyed trackers miss:

1. Varying-args / fixed-result: a non-idempotent tool (e.g. execute_code
   wrapping a web fetch) returning the same blocked/error-page body with
   different arguments on every call.
2. Repeated multimodal results: a vision tool that embeds a base64 payload
   (unique per call) but whose meaningful text caption is identical.

New config:
- same_content_warn_after: 3 (default)
- same_content_block_after: 6 (default, requires hard_stop_enabled)

The tracker is keyed by result content hash only (no args), so it operates
independently of the existing signature-based failure and no-progress
trackers, which are scoped to idempotent tools or exact argument matches.
@alt-glitch alt-glitch added type/feature New feature or request comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Jul 7, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #60087 (earliest open canonical for #60084). Both add a content-hash-only result-repetition tracker to agent/tool_guardrails.py that catches varying-args/fixed-result loops; the only differences are field/knob names and a min_chars exemption in #60087. Distinct axis from #57851 (same-call-repeat). A maintainer picks which to merge.

@kyssta-exe

Copy link
Copy Markdown
Contributor Author

Stale — 7-8 days without merge activity. Can resubmit if still needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Tool-loop guardrails miss loops where args vary but the result never changes (incl. repeated multimodal results)

2 participants