Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow AbstractPlugin to handle $/progress notification #2494

Closed
jfcherng opened this issue Jun 21, 2024 · 0 comments · Fixed by #2496
Closed

Allow AbstractPlugin to handle $/progress notification #2494

jfcherng opened this issue Jun 21, 2024 · 0 comments · Fixed by #2496

Comments

@jfcherng
Copy link
Contributor

jfcherng commented Jun 21, 2024

Description

Similar to #2493 but this time is asking for $/progress notification, whose payload is more structured than window/logMessage.

Currently $/progress notification is handled by LSP automatically at

def m___progress(self, params: ProgressParams) -> None:
and not propagated to the client (LSP-copilot in our case).

Use Case

While implementing LSP-copilot's chat (or say "conversation" in its official term) feature,

  • We asked Am I working in Sublime Text?.
  • Eventually, the server answered No, you are working in an IDE called vscode. in a $/progress notification.

However, all responses from the copilot.vim server in this conversation are $/progress. Currently, there is no way for a client to handle any of them and hence LSP-copilot can't get the answer from the server.

Communication Payloads

:: [15:00:05.997] --> LSP-copilot conversation/turn (8): {'conversationId': 'f4302595-dbbe-4411-9d82-e2367aa74217', 'message': 'Am I working in Sublime Text?', 'workDoneToken': '5'}
:: [15:00:06.011] <-  LSP-copilot $/progress: {'token': '5', 'value': {'kind': 'begin', 'title': 'Conversation f4302595-dbbe-4411-9d82-e2367aa74217 Turn e462ef0d-09c8-4e66-bb5e-5cf5fc0d99d7', 'conversationId': 'f4302595-dbbe-4411-9d82-e2367aa74217', 'turnId': 'e462ef0d-09c8-4e66-bb5e-5cf5fc0d99d7'}}
:: [15:00:06.011] <-  LSP-copilot $/progress: {'token': '5', 'value': {'kind': 'report', 'conversationId': 'f4302595-dbbe-4411-9d82-e2367aa74217', 'turnId': 'e462ef0d-09c8-4e66-bb5e-5cf5fc0d99d7', 'steps': [{'id': 'collect-context', 'title': 'Collecting context', 'status': 'running'}]}}
:: [15:00:06.521] <-  LSP-copilot $/progress: {'token': '5', 'value': {'kind': 'report', 'conversationId': 'f4302595-dbbe-4411-9d82-e2367aa74217', 'turnId': 'e462ef0d-09c8-4e66-bb5e-5cf5fc0d99d7', 'steps': [{'id': 'recent-files', 'title': 'Resolving recent files', 'status': 'completed'}]}}
:: [15:00:06.521] <-  LSP-copilot $/progress: {'token': '5', 'value': {'kind': 'report', 'conversationId': 'f4302595-dbbe-4411-9d82-e2367aa74217', 'turnId': 'e462ef0d-09c8-4e66-bb5e-5cf5fc0d99d7', 'steps': [{'id': 'collect-context', 'title': 'Collecting context', 'status': 'completed'}]}}
:: [15:00:06.521] <-  LSP-copilot $/progress: {'token': '5', 'value': {'kind': 'report', 'conversationId': 'f4302595-dbbe-4411-9d82-e2367aa74217', 'turnId': 'e462ef0d-09c8-4e66-bb5e-5cf5fc0d99d7', 'steps': [{'id': 'generate-response', 'title': 'Generating response', 'status': 'running'}]}}
:: [15:00:08.287] <-  LSP-copilot $/progress: {'token': '5', 'value': {'kind': 'report', 'conversationId': 'f4302595-dbbe-4411-9d82-e2367aa74217', 'turnId': 'e462ef0d-09c8-4e66-bb5e-5cf5fc0d99d7', 'reply': 'No, you are working in an IDE called vscode.', 'annotations': [], 'hideText': False}}
:: [15:00:09.233] <-  LSP-copilot $/progress: {'token': '5', 'value': {'kind': 'report', 'conversationId': 'f4302595-dbbe-4411-9d82-e2367aa74217', 'turnId': 'e462ef0d-09c8-4e66-bb5e-5cf5fc0d99d7', 'steps': [{'id': 'generate-response', 'title': 'Generating response', 'status': 'completed'}]}}
:: [15:00:09.233] <-  LSP-copilot $/progress: {'token': '5', 'value': {'kind': 'end', 'conversationId': 'f4302595-dbbe-4411-9d82-e2367aa74217', 'turnId': 'e462ef0d-09c8-4e66-bb5e-5cf5fc0d99d7', 'followUp': {'message': 'What are the main features of vscode?', 'id': '1eb5f524-4be6-4061-a2a8-029e94bcc00a', 'type': 'Follow-up from model'}, 'suggestedTitle': 'IDE Comparison: Sublime Text vs vscode', 'skillResolutions': [{'skillId': 'recent-files', 'resolution': 'unresolvable', 'labels': [], 'files': [], 'resolutionTimeMs': 12}, {'skillId': 'project-labels', 'resolution': 'unresolvable', 'labels': [], 'files': [], 'resolutionTimeMs': 14}, {'skillId': 'references', 'resolution': 'unresolvable', 'labels': [], 'files': [], 'resolutionTimeMs': 0}, {'skillId': 'current-editor', 'resolution': 'unresolvable', 'labels': [], 'files': [], 'resolutionTimeMs': 1}], 'updatedDocuments': []}}

C.c., @TerminalFi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant