Skip to content

[BUG]Regarding automatic file truncation #8149

@chenxluo

Description

@chenxluo

Problem (one or two sentences)

The automatic truncation feature for overly long content doesn't seem to work for JSON files. Even though I've set a limit of 50 lines, whenever the model requests to read a JSON file, the context almost always ends up being too long.

Context (who is affected and when)

Image Image

Reproduction steps

1.On Windows 11

2.There is a multi-line JSON file in the project directory larger than 2MB

3.The model's request to read the file was approved

Expected result

The file should be properly truncated, and the added context should remain under 10k tokens.

Actual result

The context rapidly exceeds the maximum limit.

Variations tried (optional)

No response

App Version

v3.28.3

API Provider (optional)

Google Gemini

Model Used (optional)

No response

Roo Code Task Links (optional)

No response

Relevant logs or errors (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue/PR - TriageNew issue. Needs quick review to confirm validity and assign labels.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions