Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

gh PR comments/reviews and git diff output still truncated, causing repeated fetch attempts by AI agents #354

@iwata

Description

@iwata

Summary

When using rtk with Claude Code, output from `gh` CLI (PR comments, review data) and `git diff` is frequently truncated, forcing the AI agent to retry fetches multiple times before it can begin actual work. This significantly delays productivity.

Related Issues

These addressed specific cases, but the broader problem persists for PR review comments and large diffs.

Reproduction

  1. PR review comments: `gh api repos/OWNER/REPO/pulls/123/comments` — output is truncated when there are many comments, requiring multiple fetch attempts
  2. PR review data: `gh pr view 123` with substantial review threads — truncated output
  3. git diff: Large diffs are cut off, requiring multiple read attempts before Claude can analyze changes

Impact

  • Claude spends significant effort retrying truncated GitHub review comments across multiple sessions, delaying actual code fixes
  • Git diff output truncation causes unnecessary back-and-forth before Claude can analyze changes
  • Overall workflow is slowed considerably by what should be single-fetch operations

Suggestion

Consider one or more of:

  1. Passthrough mode for gh api: Since API responses are consumed programmatically, pass them through unfiltered
  2. Pagination-aware filtering: When gh api uses pagination flags (--paginate), preserve full output
  3. Per-item fetching: For collections (PR comments), fetch and filter individually rather than truncating the batch
  4. Configurable truncation limits: Allow users to set higher thresholds for specific command categories (e.g., gh, git diff)
  5. Smart truncation for git diff: Preserve diff structure (file headers, hunk headers) even when truncating content

Environment

  • rtk 0.25.0
  • gh CLI
  • Claude Code
  • macOS (darwin arm64)

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