Skip to content

VS Code LM API unable to get the correct context sizeΒ #6290

@NaccOll

Description

@NaccOll

App Version

3.24.0

API Provider

VS Code Language Model API

Model Used

copilot - gpt-4.1

Roo Code Task Links (Optional)

No response

πŸ” Steps to Reproduce

Select "VS Code LM API", then choose "copilot - gpt-4.1". First, send a message saying "hi", at which point the context size will increase to just over 8k. Then, drag and drop some files into the dialog box to send them, and you'll notice that the context changes very little.

πŸ’₯ Outcome Summary

expected to correctly calculate the context size, but apart from the system prompt being accurately accounted for, the conversation content has very little impact on the context size.

Image Image Image

πŸ“„ Relevant Logs or Errors (Optional)

The updated VS Code's countTokens takes LanguageModelChatMessage2 rather than LanguageModelChatMessage.

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

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions