-
Notifications
You must be signed in to change notification settings - Fork 36.5k
Closed
microsoft/vscode-copilot-chat
#1759Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugchat-agent
Milestone
Description
The model tried to read from a line number that doesn't exist twice:
The file only had 498 lines. Here is the first tool call:
# Tool Call - toolu_01EPA3tz4EK5HHFca39CDWfh__vscode-1761817999475
## Request
~~~
id : toolu_01EPA3tz4EK5HHFca39CDWfh__vscode-1761817999475
tool : read_file
args : {
"filePath": "/Users/alex/src/vscode/src/vs/editor/test/common/model/tokensStore.test.ts",
"offset": 535,
"limit": 50
}
~~~
## Response
~~~
```typescript
```
~~~
Notice how we don't communicate to the model that this file doesn't have 535 lines at all. Then the model goes and tries again:
# Tool Call - toolu_01XFdtzdCYw5ViMycduyhJon__vscode-1761817999476
## Request
~~~
id : toolu_01XFdtzdCYw5ViMycduyhJon__vscode-1761817999476
tool : read_file
args : {
"filePath": "/Users/alex/src/vscode/src/vs/editor/test/common/model/tokensStore.test.ts",
"limit": 20,
"offset": 525
}
~~~
## Response
~~~
```typescript
```
~~~
The model is just trying to guess its way to the file size. IMHO we should report an error when the offset is > the line count in the file and explain in the error the actual file's line count. This should help the model recover faster and avoid doing two invalid read file tool calls in a row.

Copilot
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugchat-agent