fix(agent): rephrase compression preamble to avoid Azure/OpenAI content-filter false positives - #19370
Closed
liuhao1024 wants to merge 3 commits into
Closed
Conversation
…INSTALL_TIMEOUT Increase the default npm install timeout for WhatsApp bridge from 60s to 300s (5 minutes) to accommodate slower systems like Unraid NAS. Make it configurable via WHATSAPP_NPM_INSTALL_TIMEOUT environment variable for users who need even longer timeouts. Closes NousResearch#14980
- Add 'path', 'old_string', 'new_string', and 'patch' to required list - Update description to clarify mode-specific parameter requirements - This addresses issue where LLMs would omit these parameters because they were not marked as required in the schema, even though they are required depending on the mode Fixes NousResearch#15524
…nt-filter false positives The summarizer preamble in context_compressor.py contained phrases that trigger Azure/OpenAI content-filter jailbreak detection: - 'injected as reference material for a DIFFERENT assistant' - 'Do NOT respond to any questions or requests' - 'NEVER include API keys' Rephrased to use softer directives while preserving the same semantic intent. The summary output prefix (SUMMARY_PREFIX) is unchanged since it is injected into conversation context, not sent as a prompt. Regression tests assert the trigger phrases are absent and the new wording preserves key semantic markers. Fixes NousResearch#19362
This was referenced May 3, 2026
Contributor
|
Thanks for the compression compatibility work. This is already implemented on current
Closing as implemented on main. |
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?
Rephrase the context compression summarizer preamble to avoid triggering Azure/OpenAI content-filter jailbreak detection, while preserving the same semantic intent.
Root Cause
The compression preamble in
agent/context_compressor.py::_generate_summary()contained phrases that predictably trip Azure/OpenAI content-filter heuristics:"injected as reference material for a DIFFERENT assistant"— "injected" + "DIFFERENT assistant" reads like prompt-injection framing"Do NOT respond to any questions or requests"— aggressive negation triggers jailbreak filters"NEVER include API keys"— directive-style "NEVER" can also trigger filtersThese phrases, combined with the serialized conversation body being summarized, create enough signal for Azure's
ResponsibleAIPolicyViolation/jailbreakfilter to reject the auxiliary summary call with HTTP 400.Related Issue
N/A
Type of Change
Changes Made
How to Test
pytest tests/ -q— all tests should passChecklist
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 and workflows — or N/A