-
Notifications
You must be signed in to change notification settings - Fork 1
Bug: relevance_patch_agent saves literal file reference strings instead of erroring #6
Copy link
Copy link
Open
Description
Summary
When passing a file path reference like {{FILE:/tmp/prompt_for_patch.txt}} as a value to relevance_patch_agent, the tool saves the literal string {{FILE:/tmp/prompt_for_patch.txt}} as the field value instead of either resolving the file or returning an error.
This silently overwrote a 35,858-character system prompt with a 34-character garbage string, breaking a production agent.
Steps to Reproduce
- Call
relevance_patch_agentwith:{ "agent_id": "...", "patch": {"system_prompt": "{{FILE:/tmp/prompt_for_patch.txt}}"} } - The tool returns
"patched": truewithsystem_prompt_length: 34 - The agent's system prompt is now the literal string
{{FILE:/tmp/prompt_for_patch.txt}}
Expected Behavior
Either:
- Option A (preferred): Reject the input with an error if the value looks like a file reference template (matches
{{FILE:...}}pattern) - Option B: Document clearly that MCP tool parameters are always literal values with no template resolution
Impact
- Severity: High — silently destroys agent config with no warning
- The tool returns
"patched": truewhich makes it look like success - Only the
system_prompt_lengthin the response reveals the problem (34 vs expected 35,858)
Suggested Fix
Add input validation: if any string value in patch matches {{FILE:...}} or similar template patterns, return an error explaining that file references are not supported and the actual content must be passed directly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels