Repository navigation
Description
Updated to latest 0.14.0 Copilot today, Eclipse 4.38.
GitHub Copilot 0.14.0.202512112209 com.microsoft.copilot.eclipse.feature.feature.group GitHub Copilot
Chat view is unusable. Any request / prompt shows the error below, with different models in "Ask" mode on different files and with trivial questions like /explain or "what does this class?".
org.eclipse.lsp4e
Error
Fri Dec 12 09:21:45 CET 2025
[Error] [chat] Error processing turn 861097da-6faf-43c8-9c8c-2b5eb97f9848 Error: maxTokens must be larger than the ellipsis length
at t.elide (/snapshot/copilot-client/prompt/src/elidableText/elidableText.ts:118:19)
at /snapshot/copilot-client/lib/src/conversation/prompt/conversationPromptEngine.ts:112:72
at Array.map (<anonymous>)
at q0.elideChatMessages (/snapshot/copilot-client/lib/src/conversation/prompt/conversationPromptEngine.ts:105:14)
at q0.toPrompt (/snapshot/copilot-client/lib/src/conversation/prompt/conversationPromptEngine.ts:67:45)
at processTicksAndRejections (node:internal/process/task_queues:105:5)
at Zz.buildConversationPrompt (/snapshot/copilot-client/lib/src/conversation/turnProcessorStrategy.ts:79:16)
at Bje.processWithModel (/snapshot/copilot-client/lib/src/conversation/turnProcessor.ts:189:36)
at Bje.process (/snapshot/copilot-client/lib/src/conversation/turnProcessor.ts:90:13)
at handleConversationCreateChecked (/snapshot/copilot-client/agent/src/methods/conversation/conversationCreate.ts:137:5)
It looks like the problem appears because we have few (~50) projects containing .github/copilot-instructions.md files in the workspace.
If I make the file empty, the problem disappears.
Note: the Chat view was asked on a fully unrelated file from a different project, on which the instructions of other projects shouldn't apply at all.
Update
It looks like there is a max limit of characters that could be used in .github/copilot-instructions.md file, multiplied by number of files in git repository.
With ~1700 characters for ~50 projects Chat view shows an error, with ~1300 it seem to work.
Reducing number of files also helps.
So the bug is:
Copilot plugin puts all found .github/copilot-instructions.md files from all projects into the context of the conversation in a Chat view, even if conversation scope is a file in a fully unrelated project (from the same git repository).
The first project below, with no instructions at all still seem to be affected by instructions from other projects
common git repo
--> Project/<no github instructions>
--> ProjectA/.github/copilot-instructions.md
--> ProjectB/.github/copilot-instructions.md
--> ProjectC/.github/copilot-instructions.md
--> ProjectD/.github/copilot-instructions.md
--> ProjectE/.github/copilot-instructions.md
--> ProjectF/.github/copilot-instructions.md
Activity
iloveeclipse commentedon Dec 12, 2025
It looks like there is a max limit of characters that could be used in that file, multiplied by number of files.
With ~1700 for ~50 projects it shows an error, with ~1300 it seem to work.
Reducing number of files also helps.
So the bug is:
Copilot plugin puts all found
.github/copilot-instructions.mdfiles from all projects into the context of the conversation in a Chat view, even if conversation scope is a file in a fully unrelated project (from the same git repository).The first project below, with no instructions at all still seem to be affected by instructions from other projects
iloveeclipse commentedon Dec 12, 2025
Actually I've noticed this problem exists also in 0.13.1 version, the reason I see it now is that I've got the updated
.github/copilot-instructions.mdfile with more content on my branch.So it is not a regression in 0.14.0 but just a bug :-(
jdneo commentedon Dec 15, 2025
Basically the content of those instructions will be put as part of the context for the model. And because each model will have max token limitation, if the context is too big (bigger than the max token limitation), it breaks.
I saw there are two bugs actually in this ticket.
iloveeclipse commentedon Dec 15, 2025
In Eclipse model, files are grouped by projects, projects may have specific settings, and there are workspace settings if nothing is defined in a project (user can also open "external" files, not located in any project, but this is the corner case, so let skip this for now).
Additionally to that, we have git (and other version control systems) where some projects might be physically located and may want to share common "repository" settings (even if these settings are located outside of any Eclipse project).
So let assume we have a Chat view opened with a single file context (simple case).
What would we need to provide right instructions file (efficiently, assuming we have to deal with workspaces of unlimited size, so like ~1.000 projects or 500.000 files)?
For a given path in the workspace the algorithm would need to check
<project>.github/.copilot-instructions.mdfile. If it exists, use this file.To avoid heavy IO (searching VCS root every time), let have a simple cached data structure, name it
InstrutionsLookupand keep there map of "Project root path -> VCS root path", also one could cache there last lookup results.Now one can have multiple files in the context, so additionally the algorithm would need to do following:
jdneo commentedon Dec 15, 2025
Yes for sure we can resolve all the 'relevant' instruction files according to the attached context files.
What about user does not attach any context file and expects LLM to figure it out by itself? Especially when we have semantic search tool and more and more powerful models nowadays.
Recently when I use copilot, in most cases I will not attach any context file and usually the LLM can handle the case gracefully.
iloveeclipse commentedon Dec 15, 2025
Workspace instructions file (if any), or dialog asking to create one / select one from the list to be the "default" workspace instructions file. Also you could specify whether workspace instructions should be overridden by project specific instructions or should be added to the project instructions, both can make sense.
But for now, if the Chat view doesn't have a context file linked, it can't and should not use some instructions file from "automatically" found instructions files set.
If there is only one file found in the workspace, you may think this is correct one, but this is wrong.
jdneo commentedon Jan 9, 2026
Currently the workaround is to close irrelevant projects in workspace. I've thought about introducing a dialog to allow user to configure the 'working projects', but get paused since it's actually similar to closing/opening projects.
Still thinking about the solution...
iloveeclipse commentedon Jan 9, 2026
Not possible. We have ~300 interdependent projects. Closing some / most will create lot of compilation errors.
If there are no files, let ask user & set it as a "prefferred workspace instructions file", but for the rest just find what is directly related as proposed above.
jdneo commentedon Jan 9, 2026
Only pick the instruction from the project where the context belongs to is fine in most cases. But what if:
The user's prompts results in the LLM to modify the project of the context and its interdependent projects?
iloveeclipse commentedon Jan 9, 2026
I assume Copilot UI will not parse the prompt, so it has to add instructuctions to agents before LLM realizes the "other" projects are affected. I would assume adding workspace level instructions could be fine in that case.
Another possibility is to check upfront how much "known" instruction files exists and if there are not too many / too big, use them all, but as I've mentioned earlier, it would make no sense in hybrid environments, where fully different projects from fully different repositories are existing. One says "don't touch C++ code, it is generated JNI stubs", the other says exact the opposite "don't touch Java code, it's generated from IDL files".
So honestly, by default, I would only use instructions from the context projects & workspace level.
Maybe another possibility would be that if user finds out, there are "other" projects involved (not directly in the context), offer the possibility to configure that in the Chat view, similar to files, add projects to the context.
[-]Chat view doesn't work, reports "Error: maxTokens must be larger than the ellipsis length"[/-][+]Copilot instructions affect unrelated projects, Chat view doesn't work, reports "Error: maxTokens must be larger than the ellipsis length"[/+]iloveeclipse commentedon Apr 29, 2026
OK, discussed this shortly in person.
For most files in Eclipse which can be referenced in the Chat view, a project is given. If this project has
.github/copilot-instructions.mdfile, agent can "know" the right instructions automatically.The main point to solve now is: "what if agent need to modify other files from different projects", how we can give him right instructions there (assuming they differ from originally referenced project).
The proposal: let add some kind of "instructions picker" widget in the Chat view, which would allow user to select other instruction files found in the workspace. It could be "kind of" combo box with checkboxes inside or simply a button which would open a dialog showing all found unique instruction files found in the workspace.
By default, the Chat view and picker would have selected the instruction files from all the projects of the files added to the Chat context, and show all other found instruction files as not selected.
WDYT?
jdneo commentedon Apr 29, 2026
Will it make sense if we introduce this preference page like in VS Code?
iloveeclipse commentedon Apr 29, 2026
This alone may not solve our problem with ~200+ projects in the workspace, each having some
instructions.mdfile.Right now we have ~3 different
instructions.mdfiles "per software layer". Every project from a specific layer links to one of htese files. There are also specificinstructions.mdfiles for test projects, UI / headless project etc.So in such preference page one would see ~200+ instruction files. Not sure the table alone would be helpful, but yes, at least one could exclude most of the files from the list, whch would be a workaround for us.
Since most of the files are links, let assume the preference page will sort it out and show only 10 real files.
With those ~10 "real" files, each 10K big (approx ~2500 words) we will pass 100K to LS on every conversation. It may work physically for now (and stop working tomorrow if people add more content to their files), but even now with 10+ files agent will see fully different, partly contradicting instructions for the file in Chat context. It will see instructions for Eclipse Java plugins code that works with UI, headless Java code running in fully different context, C++ code for HW drivers, shell code talking via ruby or python with some Linux programs... Double that chaos by separated instructions for test projects and production projects... Not sure it would make sense from AI answers quality point of view and if it will scale in long term.
But let assume we will provide preference page for every file found in the workspace, what about adding a checkbox or radio boxes above the table with found instruction files like:
"For the conversations in the Chat view:"
For us, with our 200+ instruction files, we would simply set the second preference by default and everyone will be happy.
WDYT?
jdneo commentedon Apr 29, 2026
Ah, I checked the implementation of CLS side, and found that the way how instruction files are discivered
copilot-for-eclipse/com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/CopilotLanguageServerConnection.java
Line 291 in f94e037
.github/copilot-instructions.mdper workspace folders.So seems that instead of limit the .md files discovery, we should limit the workspace folders. (That's way previously we have explored about working project concept)
iloveeclipse commentedon Apr 29, 2026
Correct. I see
org.eclipse.lsp4e.LSPEclipseUtils.getWorkspaceFolders()returns all projects in the workspace unconditionally. Ideally this should be just the projects for all files referenced in the Chat vew.Again, if the agent will need to know about other projects, we might use preference page to check which instruction files are "enabled" and additionally put their projects to the list of "WorkspaceFolders".
jdneo commentedon Apr 29, 2026
So there will be a new preference, enum type, indicating how the workspace folders (projects) pass to CLS, candidate values are:
travkin79 commentedon Apr 29, 2026
I've read all your posts here. I would like to elaborate a solution, but I doubt that we have the same expectations and understanding. So let's try to summarize and clarify a few things.
If I don't misunderstand you, the major issues with the current state are
That leads to the main question: What are the relevant custom instructions for a set of files in the context (selected in the chat view) and the current workspace?
AFAIK we need to respect the following concepts / conventions:
<project>/.github/copilot-instructions.md) -- I'd say, they should always apply if files will be read / modified in that project<repo root dir>/.github/copilot-instructions.md) -- I'd say, they should always be applied if files will be read / modified in that git repo~/.copilot/copilot-instructions.md) -- I'd say, these should always be applied if availableIf we focus on files explicitly added to the context, I would suggest the following process of adding custom instructions.
Sheng Chen (@jdneo) and Andrey Loskutov (@iloveeclipse), do you agree with that part?
The steps above don't handle the following case:
In order to handle that case, too, I though of a kind of scope analysis step to automatically find additional projects involved in the requested agent task? Is that possible? If that is somehow possible, we could append the following steps to the previous process to add the custom instructions from these additional projects and their git repos.
In addition, I didn't cover symbolic links pointing to effectively same instruction files.
Sheng Chen (@jdneo) suggested the following.
Picking up Andrey Loskutov (@iloveeclipse)'s arguments, I doubt that loading custom instructions from all projects in the workspace is a good idea in any case. I suggest to always load only relevant custom instructions.
jdneo commentedon Apr 30, 2026
One more comment from my side:
When you are using a powerful model, it can find all related files via different search approaches. This makes it less likely that context files needs to be manually attached. Thus, inferring the related projects based on attached files won't be always reliable.
I think maybe(?) the right approach to support your case is to support to *.instructions.md, see: https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/add-custom-instructions/add-repository-instructions#creating-path-specific-custom-instructions
That means, you put all the needed instruction files to a single place - the root of your git folder (/.github/instructions/*.md). Then we have a picker or table to let user enable/disable the instructions
Andrey Loskutov (@iloveeclipse) said there are around 10 unique instructions, I think it is acceptable to render ~10 entries in a table or picker?
travkin79 commentedon Apr 30, 2026
Hi Sheng Chen (@jdneo),
I agree with that. From a user's point of view, I'd wish that the LLM / IDE automatically picks up the relevant files and also the relevant custom instructions, without having to configure anything (if possible). Assuming the LLM can find related files itself, we could maybe also assume, the LLM can pick up related custom instructions itself, too. I'd conclude that (for now) we don't need to explicitly load custom instructions from potentially related projects, i.e. for files / projects that are not in the context (that should likely be decided by the LLM).
But I think for files that are part of the context (or part of the agent's "working directory"), we should explicitly and deterministicly load custom instructions. For this case, the control flow from my first diagram could by a solution. That would mean that in general, we would no longer load custom instructions from all projects, but would load only relevant ones. Then we need to agree on what "relevant" means. What do you think, Sheng Chen (@jdneo) and Andrey Loskutov (@iloveeclipse)?
That's a really interesting idea and might solve the case described by Andrey Loskutov (@iloveeclipse). That could complement what I suggested above. If I understand the docs correctly, the custom instructions could be automatically picked up using glob patterns in an instruction file's front matter block e.g.
applyTo: "app/models/**/*.rb". Do we then still need to actively choose the instruction files to be used in a session (or in general)? According to the docs, the instruction files can be de-activated for the code-review agent (if needed), but that could also be done in the front matter block of an instructions file.Concerning the instruction files selection dialog from VSCode, it looks to me as if its main purpose is to re-use the custom instructions from Claude and other AI tools. Maybe it would be helpful if users could decide, whether they want to include these additional (non-Copilot) instructions or not, by using an Eclipse preferences page. (Besides, it seems, the VSCode dialog does not cover all conventions for custom instructions, e.g.
copilot-instructions.mdandAGENTS.md(used by Copilot CLI) don't match the file pattern*.instructions.mdfrom the dialog.)iloveeclipse commentedon Apr 30, 2026
Unfortunately this isn't applicable for our use case.
We enforce "standard" project settings, files etc in each project. We have lot of projects, so to avoid code duplication, if project code owners don't need extra settings, they simply link to the default templates. This is what I meant that we might have not 200 but just 10 "real" files, others are just links.
So every project has its own settings files linked to templates or can have custom.
Putting every project specific files to the root of the git repo would make no sense, as it would cause extra overhead maintaining projects <-> settings for every project.
We are going in rounds here. Relevant projects are those matching the files added to the context, but again, if agent would need to touch files outside the context, it may want to need instructions from additional projects.
Can we for now simply implement preference proposed in this comment?
This is most simple solution, which will immediately help. All extra enhancements can follow up.
jdneo commentedon Apr 30, 2026
Yes, that is the most direct and fast approach.
I think I also need to check the cls implementation if it already dedup the instructions that link to the same original file.
Andrey Loskutov (@iloveeclipse) How are those files linked? symbol link?
iloveeclipse commentedon Apr 30, 2026
Yes
travkin79 commentedon Apr 30, 2026
Ok, I could try implementing a PR for that.
[-]Copilot instructions affect unrelated projects, Chat view doesn't work, reports "Error: maxTokens must be larger than the ellipsis length"[/-][+]Add Copilot preference for a chat's custom instructions loading[/+]iloveeclipse commentedon May 20, 2026
This ticket should be fixed now in 0.18 via #136.
Thanks everyone involved.