-
Notifications
You must be signed in to change notification settings - Fork 32
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
Feature/GitHub copilot #49
base: main
Are you sure you want to change the base?
Conversation
@aislasq Hey there! Sorry for the late reply, weekends are my time for looking at open source. This is exciting! I haven't played with Copilot since beta, I'd be really happy to play with again in Oatmeal.
So your biggest issue here is the fact you want to do the initial authentication from inside Oatmeal. What if you didn't? I'm imagining on first run if
Is this a short lived token, 15 minutes? Or is it a long lived token managed by the Github CLI? |
Refactored the code as you suggested. It is more straightforward. I do believe we could handle the login from within Oatmeal, but maybe later. The token's lifetime is 30 min, which is just long enough for a question/session. I have it set up to save it in the struct, but I cannot mutate it; a hacky thing I could do is to save it in the messages context with { role: "token", content: ":" }. |
Let's do that! I can refactor the model to allow mutations in the future. :) Thank you very much! |
I added the serialized session token to the content and added expiration management, along with the 3 new tests. It looks like the hosts.json file where the oauth token is for third party extensions so Although I suspect some users will already have this token from other clients, I think we should give a clearer message that the device login is not yet implemented in Oatmeal. What do you think that should be? |
Odd, so there's no token file provided anywhere for the
I agree! We for sure want to specify you must login in another form, but it's best to provide how. I'm finding it difficult to see answers when quickly searching online. Do all the other existing implementation do it themselves? I'm almost wondering if it's worth adding a CLI command to create the token initially as you've already done the bulk of the work for authorization, with the goal of taking the easiest/fastest solution. I wouldn't want you spending hours trying to recreate something that already exists externally. |
At least on my tests there is not. I've been looking in my computer and cannot find where is the configuration saved for gh or vscode. I also tested with copilot.lua (my daily client) and they have the auth implementation (in lua) as a command as you suggested. I've seen other examples of the authentication flow in typescript and python, though I don't have the repos on hand. I'll try to add the auth as a command with the authentication flow I have. I'll try to use |
I was thinking a command line call. Taking it out of the UI would probably be easiest as it gives you a bit more control to do what you need. |
I added the new command I want to check with you on a couple of things:
|
I'm so sorry for the super late reply. I've been really out of the loop this month. Service works for me! |
So I ended up adding a couple of things.
|
This is a first draft to add github copilot to Oatmeal. It is working fine, but it is very hacky to adjust the Github Copilot login flow. I am out of my means here and would appreciate some help.
done: true
, so the pending result will be appended to the message bubble.