Built-in functions.view returns no content for large files despite documenting automatic truncation

Abierto Apto para principiantes
#5,476 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
cli, tooling

Línea de trabajo

El issue identifica la herramienta integrada functions.view y presenta un caso reproducible con un archivo de texto de 26.400 bytes sin view_range. Empieza por localizar la implementación y la descripción de la herramienta; después, compara la respuesta para archivos grandes con el comportamiento de truncamiento documentado. La tarea está terminada cuando el comportamiento y la descripción coincidan; reproduce el caso y comprueba que el ejemplo de view_range siga funcionando.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area:tools
Describe the bug

The built-in functions.view tool’s description says text files larger than 20KB are truncated. However, reading a larger file without view_range returns only a size-limit message, with no file content.

The exact text from the tool description is:

View files, images, or directories.

  • Images return base64 data and MIME type.
  • Text files return their content.
  • Directories list non-hidden entries up to 2 levels deep.
  • path must be absolute.
  • Files over 20KB are truncated; use view_range for sections.

Thus, it's expected that just calling view for a text file larger than 20KB would return a truncated version of that content at 20KB.

Affected version

1.0.112

Steps to reproduce the behavior
  1. Create a synthetic 26,400-byte, 800-line text file:
    python3 -c 'from pathlib import Path; Path("view-size-repro.md").write_text("0123456789abcdef0123456789abcdef\n" * 800, encoding="utf-8")'
  2. In Copilot CLI, ask:
    Use the built-in view tool to read view-size-repro.md.
    For this test, omit view_range and forceReadLargeFiles.
  3. Observe that the tool returns only:
    File too large to read at once (25.8 KB). Consider using the rg tool to search within the file, or view with view_range to read specific sections.
  4. Ask it to read the same file with view_range: [1,5]. The five lines are returned successfully.
Expected behavior

functions.view behavior should match the tool description, whether that means adjusting the tool description or the tool behavior

Additional context

No response

Lenguaje dominante
Python
Estrellas
11.5k
Forks
2k
Merge medio
6 h 34 min
PR fusionados (30 d)
3

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de github/copilot-cli

Todos los issues de github/copilot-cli

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.