CopilotForXcode icon indicating copy to clipboard operation
CopilotForXcode copied to clipboard

[Bug]: Can't accept suggestions

Open hedgemanNate opened this issue 1 year ago • 23 comments

Before Reporting

  • [X] I have checked FAQ, and there is no solution to my issue
  • [X] I have searched the existing issues, and there is no existing issue for my issue

What happened?

Slight variation on a known issue.

Copilot stopped allowing me to accept its suggestions. Nothing would type when I clicked "Accept" or when I pressed tab. However, I would have to click back on to Xcode to continue typing.

This began after the last update.

After reading similar issues, I tried suggested solutions. I also tried the solutions in the FAQ. None worked for me.

What endup up simi-working was turning on the 'Always accept suggestion with Accessibility API' toggle. I can accept suggestion now, however now when I do, the page scrolls to the top and then jumps back down to where I was typing. Which is fine, but I know that is not the intended function and it used to work as expected and without that toggle being on.

How to reproduce the bug.

Just use xcode with copilot on as normal, and wait for a suggestion.

Relevant log output

No response

macOS version

14.3

Xcode version

15.3

Copilot for Xcode version

0.32.0

hedgemanNate avatar Apr 17 '24 00:04 hedgemanNate

Did you restart Xcode after updating the extension?

intitni avatar Apr 17 '24 00:04 intitni

Did you restart Xcode after updating the extension?

Yes I did. Several times.

hedgemanNate avatar Apr 17 '24 00:04 hedgemanNate

Also to clarify, when I type TAB to accept the suggestion the page does just jump and does not return to where I was typinp.

hedgemanNate avatar Apr 17 '24 00:04 hedgemanNate

Please check that the menu Editor > Copilot in Xcode menubar exists and is not greyed out. If it doesn't exist, you can try re-enabling the Xcode source editor extension.

Please also make sure that there is no another copy of Copilot for Xcode exist on you mac.

intitni avatar Apr 17 '24 00:04 intitni

There is no other copy on my mac and the Copilot menubar item is not greyed out.

hedgemanNate avatar Apr 17 '24 00:04 hedgemanNate

What about turning off “trigger command with accessibility api” from the advanced settings?

intitni avatar Apr 17 '24 00:04 intitni

If I turn that off, accepting suggestions do not work at all. However I will try it again now. Because I know how bugs can be intermittent.

hedgemanNate avatar Apr 17 '24 01:04 hedgemanNate

Nope, with trigger command with accessibility api toggled off, it does not accept suggestions at all.

hedgemanNate avatar Apr 17 '24 01:04 hedgemanNate

Can you accept suggestion by clicking the accept suggestion menu item in Editor > Copilot or triggering it with a key binding?

intitni avatar Apr 17 '24 01:04 intitni

Neither works.

hedgemanNate avatar Apr 17 '24 01:04 hedgemanNate

I think the source editor extension fails to communicate with the service app. Please

  1. Go to System Settings.app > General > Login Items and remove Copilot for Xcode.app from the "Allow in the Background" list.
  2. Quit and restart Copilot for Xcode.app, it should install the login item again, if it doesn't, click "Set up launch agent".
  3. Restart the Mac as the extension seems to be talking to a deleted version of the service app, which looks like a macOS bug.

intitni avatar Apr 17 '24 01:04 intitni

For step 2, I get the error: "The operation couldn't be completed. Operation not permitted." I'll restart my mac for good measure.

hedgemanNate avatar Apr 17 '24 01:04 hedgemanNate

The issue is the same.

The Copilot app now says Extension Service and Accessibility Permission are loading. And the refresh button is greyed out. Screenshot 2024-04-16 at 9 34 49 PM

hedgemanNate avatar Apr 17 '24 01:04 hedgemanNate

Please try setting up the launch agent manually following this FAQ section

intitni avatar Apr 17 '24 01:04 intitni

Ok. I will give it a shot tomorrow. It's late where I am. Thank you so much for your help tho. I will update here what happens.

hedgemanNate avatar Apr 17 '24 01:04 hedgemanNate

I have a similar issue, I can accept suggestions with the buttons but not with tab. Seems to be a new issue since the latest update (as far as I have noticed). I have followed the suggestions above with the same issues. Can't get it working again without re-enabling the "allow in background" setting in login items (I tried setting up manually).

nrbrook avatar Apr 18 '24 14:04 nrbrook

@nrbrook Sorry I can't get my head around your statement. Is it working again or still not working?

The button and tab basically do the same thing. Could you please check if the Plus license is still activated in the Plus tab? I have heard some users losing their license after an update but I honestly don't know why.

intitni avatar Apr 18 '24 14:04 intitni

I mean to get it working at all, I have to keep "allow in background" enabled (manual install doesn't work). But tab isn't working.

It is still activated.

Screenshot 2024-04-18 at 15 59 01

nrbrook avatar Apr 18 '24 14:04 nrbrook

Nevermind, it works after a reboot

nrbrook avatar Apr 18 '24 15:04 nrbrook

@nrbrook You are having a different issue. Please open Console.app, click start streaming and set the filter to

category:Service any:CopilotForXcodeExtensionService

Let me know if you see the following logs when you activate an Xcode window:

Screenshot 2024-04-18 at 23 08 59

intitni avatar Apr 18 '24 15:04 intitni

Will do if it happens again

nrbrook avatar Apr 18 '24 15:04 nrbrook

@nrbrook Great. It's probably a macOS bug.

@hedgemanNate I did some experiments and found that to reinstall the launch agent, you need to:

  1. Delete Copilot for Xcode.app, make sure it's also not in the trash bin.
  2. Restart Mac, so that it will clean the list up.
  3. Install the app again in the Applications folder.

intitni avatar Apr 18 '24 15:04 intitni

@intitni It happened again when I updated to the latest version. It seems like updating breaks it and requires a restart to fix.

nrbrook avatar Apr 30 '24 14:04 nrbrook

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar May 31 '24 01:05 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jun 14 '24 01:06 github-actions[bot]