Skip to content

[Bug]: Verbose output missing filenames for read/write/edit tools when using file_path parameter #10059

Description

@hongw

Summary

After PR #7451 fixed parameter validation, verbose tool summaries no longer show filenames when tools are called with the parameter (Claude Code convention) instead of .

Reproduction

  1. Enable verbose mode:
  2. Trigger a tool call that uses (e.g., Claude Sonnet models often use this)
  3. Observe verbose output shows only emoji + label, no filename

Expected: 📖 Read: src/agents/tool-display.ts
Actual: 📖 Read

Root Cause

src/agents/tool-display.ts functions resolveReadDetail() and resolveWriteDetail() only check for record.path and don't handle record.file_path:

function resolveReadDetail(args: unknown): string | undefined {
  if (!args || typeof args !== "object") {
    return undefined;
  }
  const record = args as Record<string, unknown>;
  const path = typeof record.path === "string" ? record.path : undefined;  // ❌ Missing file_path check
  if (!path) {
    return undefined;
  }
  // ...
}

Timeline

Proposed Fix

Update resolveReadDetail() and resolveWriteDetail() to check both parameter names:

const path =
  typeof record.path === "string"
    ? record.path
    : typeof record.file_path === "string"
      ? record.file_path
      : undefined;

This matches the parameter normalization logic already present in pi-tools.read.ts.

Impact

  • Affects all verbose tool summaries when Claude Code-style parameters are used
  • Reduces debugging visibility for read/write/edit operations

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions