-
Notifications
You must be signed in to change notification settings - Fork 254
Add POML chat participant #38
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
Add POML chat participant #38
Conversation
…dd-chat-feature-with-user-input-and-files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Chat Participant Registration Before Client Activation
A race condition exists where the chat participant is registered before the language client is activated. The chat participant's handler calls getClient().sendRequest(), which requires an initialized language client. Since registerPomlChatParticipant() is called before activateClient() in extension.ts, attempts to use the chat participant before the language server is ready will fail due to an uninitialized client.
packages/poml-vscode/chat/participant.ts#L32-L33
poml/packages/poml-vscode/chat/participant.ts
Lines 32 to 33 in 0195905
| }; | |
| const response: PreviewResponse = await getClient().sendRequest(PreviewMethodName, params); |
packages/poml-vscode/extension.ts#L48-L49
poml/packages/poml-vscode/extension.ts
Lines 48 to 49 in 0195905
| registerPomlChatParticipant(context); |
Bug: Uri Handling and Template Resolution Errors
The chat participant has two issues:
- It attempts to call
fsPathonvscode.Urireferences that may not be file URIs (e.g.,http,https), leading to errors. The current filtering only validatesUriinstance type, notfilescheme. - The
chat.pomltemplate file is incorrectly resolved relative tocontext.extensionUri. Thegalleryfolder is at the repository root, making the file inaccessible when the extension is packaged.
packages/poml-vscode/chat/participant.ts#L18-L22
poml/packages/poml-vscode/chat/participant.ts
Lines 18 to 22 in 0195905
| const filePath = vscode.Uri.joinPath(context.extensionUri, 'gallery', 'chat.poml'); | |
| const pomlContext = { | |
| prompt: request.prompt, | |
| files: files.map(f => f.fsPath), |
Was this report helpful? Give feedback by reacting with 👍 or 👎
Summary
package.jsonTesting
npm run build-webviewnpm run build-clinpm run lintnpm testpython -m pytest python/testshttps://chatgpt.com/codex/tasks/task_e_68637dd13bdc832eabc6c5e7215e8b9b