[Bug] TypeError: Cannot read properties of undefined (reading 'filter') · Issue #428 · microsoft/copilot-for-eclipse · GitHub
Skip to content

[Bug] TypeError: Cannot read properties of undefined (reading 'filter') #428

Open

Description

@tamasmiklossy

Environment

  • OS: Windows
  • Eclipse Version: 2026-06 (4.40.0)
  • Plugin Version: 0.21.0.202608060743

Describe the bug
The following error occurs in the Agent mode when there is no project in the workspace:

!ENTRY org.eclipse.lsp4e 4 0 2026-08-26 07:45:09.023
!MESSAGE [LS:GitHub Copilot Language Server][Error]	[chat] Error processing turn 72df12fd-e941-4394-adb4-2b5917d14ed7 TypeError: Cannot read properties of undefined (reading 'filter') (at tsx element AgentPrompt > UserMessage > SubagentListPrompt)
    at y0.collect (C:\snapshot\copilot-language-server-internal\dist\main.js:2411:12762)
    at t.listCustomAgents (C:\snapshot\copilot-language-server-internal\dist\main.js:2411:23507)
    at async $de.getAgents (C:\snapshot\copilot-language-server-internal\dist\main.js:3333:954)
    at async $de.getAgentsForModelDispatch (C:\snapshot\copilot-language-server-internal\dist\main.js:3333:1202)
    at async Itt.renderCopilot (C:\snapshot\copilot-language-server-internal\dist\main.js:3333:3037)
    at async annotateError (C:\snapshot\copilot-language-server-internal\dist\main.js:69:4311)
    at async C:\snapshot\copilot-language-server-internal\dist\main.js:67:29695
    at async Promise.all (index 0)
    at async jZe._processPromptPieces (C:\snapshot\copilot-language-server-internal\dist\main.js:67:29606)
    at async jZe._processPromptRenderPiece (C:\snapshot\copilot-language-server-internal\dist\main.js:67:30200)

!ENTRY org.eclipse.lsp4e 4 0 2026-08-26 07:45:09.024
!MESSAGE [LS:GitHub Copilot Language Server][Error]	[agenticTurnProcessor] Error in processing turn 72df12fd-e941-4394-adb4-2b5917d14ed7 TypeError: Cannot read properties of undefined (reading 'filter') (at tsx element AgentPrompt > UserMessage > SubagentListPrompt)
    at y0.collect (C:\snapshot\copilot-language-server-internal\dist\main.js:2411:12762)
    at t.listCustomAgents (C:\snapshot\copilot-language-server-internal\dist\main.js:2411:23507)
    at async $de.getAgents (C:\snapshot\copilot-language-server-internal\dist\main.js:3333:954)
    at async $de.getAgentsForModelDispatch (C:\snapshot\copilot-language-server-internal\dist\main.js:3333:1202)
    at async Itt.renderCopilot (C:\snapshot\copilot-language-server-internal\dist\main.js:3333:3037)
    at async annotateError (C:\snapshot\copilot-language-server-internal\dist\main.js:69:4311)
    at async C:\snapshot\copilot-language-server-internal\dist\main.js:67:29695
    at async Promise.all (index 0)
    at async jZe._processPromptPieces (C:\snapshot\copilot-language-server-internal\dist\main.js:67:29606)
    at async jZe._processPromptRenderPiece (C:\snapshot\copilot-language-server-internal\dist\main.js:67:30200)

To Reproduce
Steps to reproduce the behavior:

  1. Open a new empty workspace with no project imported into it
  2. Ensure on the Chat window Agent mode is selected
  3. Ask a question to Copilot e.g: "What day is today?"
  4. See error

Expected behavior
No error should appear

Screenshots

Image

Additional context
The problem does not occur if Ask mode is selected

Activity

  1. amvalente commented on Sep 2, 2026

    @amvalente

    This appears to be the same underlying problem reported in #403. In my case, it occurs in an Eclipse RCP application whose workspace has no standard Eclipse project.

    I can also provide the following regression test:

    • Copilot 0.21.0.202608060743: issue reproduced
    • Copilot 0.21.0.202608261610_nightly: issue still reproduced
    • Copilot 0.20.0: works correctly in the same application and workspace

    With both 0.21 builds, Agent mode fails with:

    Cannot read properties of undefined (reading 'filter') (at tsx element AgentPrompt > UserMessage > SubagentListPrompt)

    After downgrading to 0.20.0, Agent mode works without creating or importing a project. A locally configured MCP server is also discovered and its tools can be invoked successfully.

    No application, workspace, or MCP configuration changes were made between the tests. Only the Copilot Eclipse plug-in version changed.

    Given the SubagentListPrompt stack location, could this regression be related to the sub-agent enablement changes introduced by #349?

  2. tamasmiklossy commented on Sep 2, 2026

    @tamasmiklossy
    Author

    Antonio Valente (@amvalente): seems these two issues are about the same problem, good catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions