Skip to content

[Bug]: patch tool conditionally required parameters are systematically omitted #15524

@andrewxia

Description

@andrewxia

Bug Description

Summary

The patch tool's conditionally required parameters (old_string/new_string for replace mode, patch for patch mode) are systematically omitted when the tool is called via the standard tool-calling mechanism. This results in schema validation errors regardless of model (tested on kimi-k2.6 and kimi-k2.5).

Environment

  • Platform: Hermes Agent CLI
  • Models tested: kimi-k2.6, kimi-k2.5
  • Tool affected: patch

Steps to Reproduce

  1. Attempt to call patch in replace mode with old_string and new_string:
{
  "mode": "replace",
  "path": "/tmp/test.txt",
  "old_string": "line2",
  "new_string": "line2_modified"
}

Expected: Tool executes successfully.
Actual: Error "old_string and new_string required".

  1. Attempt to call patch in patch mode with patch parameter:
{
  "mode": "patch",
  "path": "/tmp/test.txt",
  "patch": "*** Begin Patch\n*** Update File: /tmp/test.txt\n@@ context @@\n-line2\n+line2_modified\n*** End Patch"
}

Expected: Tool executes successfully.
Actual: Error "patch content required".

Expected Behavior

Tool executes successfully.

Actual Behavior

Actual: Error "patch content required".

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

No response

Debug Report

Report     https://paste.rs/gUkOC
  agent.log  https://paste.rs/zsFxN

Operating System

Ubuntu 24.04

Python Version

No response

Hermes Version

No response

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/toolsTool registry, model_tools, toolsetsprovider/kimiKimi / Moonshottype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions