Skip to content

edit_file tool defers on first call when optional fuzz parameter is omitted #2138

@m1k3s0

Description

@m1k3s0

Description

The edit_file tool defers on first invocation in a session when the
optional fuzz parameter is omitted, requiring a wasteful retry turn.
The error message also incorrectly lists fuzz as an expected/required
field even though the schema marks it as optional.

Steps to reproduce

  1. Start a new codewhale session (or one where edit_file hasn't been used yet).
  2. Call edit_file with the required parameters (path, search, replace) but without fuzz.
  3. Observe the response.

Expected behavior

edit_file should execute immediately on the first call when all required
parameters are provided. Optional parameters (fuzz) should not need to
be passed to avoid deferral.

Actual behavior

The tool returns:

Tool `edit_file` was deferred and has now been loaded.
The tool was not executed. Retry with the loaded schema.

Expected fields:
  fuzz: boolean
  path: string required
  replace: string required
  search: string required

A retry with identical parameters succeeds. After the first successful
invocation, subsequent edit_file calls in the same session work on the
first attempt without fuzz.

Impact

Happens once per session per affected tool. Costs one extra turn for the
retry. On a free tier this is a minor annoyance; in a paid/production
workflow with many tool calls it adds up. The misleading error message
also wastes time diagnosing a non-problem (the user didn't forget a
required field — fuzz is optional).

Environment

  • OS: Devuan (Linux)
  • codewhale version: 0.8.44
  • Install method: cargo
  • codewhale doctor summary: All checked complete
  • Model/provider: deepseek-v4-pro / DeepSeek
  • Terminal app: MATE Terminal
  • Shell: /bin/bash

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions