Repository navigation
Fix NPE and lost chat requests while models are not loaded yet - #503
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Partial-fetch preference loss and availability-binding lifecycle issues remain unresolved.
3 open issues
What changed in this PR
This PR addresses #408 by preventing chat submission before a model is available and handling delayed or failed model loading. It complements the separate preference-loading and shutdown fixes.
Changes:
- Fetch Copilot and BYOK model lists in parallel, allowing activation despite one list failing.
- Disable sending while models load and add null-safe chat request and tooltip handling.
- Add regression tests for model loading, availability notifications, and missing-model requests.
| File | Description |
|---|---|
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/i18n/messages.properties |
Adds model-loading placeholder and tooltip text. |
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/i18n/Messages.java |
Declares the new localized messages. |
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/services/ModelService.java |
Loads model lists concurrently and observes availability. |
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/ReferencedFile.java |
Handles image tooltips without an active model. |
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/ChatView.java |
Rejects premature sends while preserving input. |
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/ChatInputTextViewer.java |
Displays the model-loading placeholder. |
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/ActionBar.java |
Gates sending on model availability. |
com.microsoft.copilot.eclipse.ui.test/src/com/microsoft/copilot/eclipse/ui/chat/services/ModelServiceTests.java |
Tests parallel loading, partial failures, and availability. |
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/CopilotLanguageServerConnection.java |
Returns failed futures for requests without a model. |
com.microsoft.copilot.eclipse.core.test/src/com/microsoft/copilot/eclipse/core/lsp/CopilotLanguageServerConnectionTests.java |
Verifies missing-model requests never reach the server. |
Review effort: Balanced
|
Hi Dietrich Travkin (@travkin79) Thank you for your contribution. Could you please check those copilot comment? |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2ffa519 to
abfa462
Compare
There was a problem hiding this comment.
🟡 Changes recommended
With preview features enabled, switching chat modes while models are pending can enable the delegation button even though sending is rejected without an active model.
1 open issue
3 resolved since last review
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
abfa462 to
bee8766
Compare
Sheng Chen (jdneo)
left a comment
There was a problem hiding this comment.
LGTM, thank you for your contribution!

Related to #408
When the Copilot language server (CLS) is busy, e.g. for minutes after startup in large workspaces, the
model lists arrive late. Until then there is no active model, and sending a chat request fails with an NPE.
Changes
createConversation,addConversationTurn, pressing Enter, referenced-file tooltip).This does not fix the busy CLS itself. It complements #452 – #455, which address UI freezes and shutdown hangs.