Skip to content

fix: tool reliability improvements for sql-classify, edit, and webfetch #581

@anandgupta42

Description

@anandgupta42

Problem

Three tool reliability issues affecting agent effectiveness:

  1. sql-classify.ts: computeSqlFingerprint references undefined core variable after safe-import refactor, silently breaking fingerprinting. Fallback classifier defaults to "read" for unknown statements (should be "write" for safety). Fallback doesn't handle multi-statement SQL.

  2. edit.ts: When oldString not found, error message provides no context for self-correction. Substring matching in buildNotFoundMessage can latch onto short irrelevant lines.

  3. webfetch.ts: No caching of failed URLs — agent retries 404s repeatedly. Error messages don't tell the model whether to retry. URLs with auth tokens in query strings leak into error messages.

Expected Behavior

  • sql-classify should gracefully degrade with correct security guarantees in fallback mode
  • Edit tool should provide nearest-match snippets to help the model self-correct
  • Webfetch should cache permanent failures and provide actionable error messages

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions