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

Zed logs error for missing ~/.config/github-copilot (linux) #17831

Closed
1 task done
anthonyryan1 opened this issue Sep 14, 2024 · 6 comments
Closed
1 task done

Zed logs error for missing ~/.config/github-copilot (linux) #17831

anthonyryan1 opened this issue Sep 14, 2024 · 6 comments
Labels
bug [core label] copilot AI feedback for Copilot inline completion Umbrella label for Copilot, Supermaven, etc. completions linux windows

Comments

@anthonyryan1
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

  1. Update settings.json to disable GitHub Copilot, because I don't want the contents of my text editor sent to a 3rd party in the background.
  "features": {
    "inline_completion_provider": "none"
  }
  1. Startup Zed
  2. Check Zed.log
grep -rni copilot ~/.local/share/zed/logs/Zed.log
2024-09-14T16:10:05.81434634-04:00 [ERROR] No such file or directory (os error 2) about ["/home/ar/.config/github-copilot"]

If copilot is properly disabled, why is it searching searching for it's config/API keys?

Environment

Zed: v0.152.3 (Zed)
OS: Linux Wayland gentoo 2.15
Memory: 31.3 GiB
Architecture: x86_64
GPU: AMD Radeon RX 570 Series (RADV POLARIS10) || radv || Mesa 24.1.6

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

No response

@sa1
Copy link

sa1 commented Sep 15, 2024

Apart from the inline provider, there's also the AI chat. I suspect Zed looks at which providers you're signed into for the chat.

@vuldin

This comment was marked as off-topic.

@anthonyryan1
Copy link
Author

Not currently preventing startup for me. No current lead on why that part differs for you.

@notpeter
Copy link
Member

notpeter commented Sep 23, 2024

Yeah, looking at the code the GitHub Copilot Chat via the Assistant panel uses that file:

fn copilot_chat_config_path() -> &'static PathBuf {
static COPILOT_CHAT_CONFIG_DIR: OnceLock<PathBuf> = OnceLock::new();
COPILOT_CHAT_CONFIG_DIR.get_or_init(|| {
if cfg!(target_os = "windows") {
home_dir().join("AppData").join("Local")
} else {
home_dir().join(".config")
}
.join("github-copilot")
.join("hosts.json")
})
}

I was able to reproduce by removing my .config/github-copilot/ directory and restarting Zed. I tried on Linux/MacOS, but the error only showed on linux.

Thanks for reporting.

@notpeter notpeter added linux copilot AI feedback for Copilot and removed triage labels Sep 23, 2024
@notpeter notpeter changed the title Zed is looking for ~/.config/github-copilot even when copilot is disabled Zed logs error for missing ~/.config/github-copilot (linux) Sep 23, 2024
@notpeter
Copy link
Member

notpeter commented Oct 18, 2024

I did some digging and I believe this is happening because we add a watch for ~/.config/github-copilot/hosts.json.

let mut config_file_rx = watch_config_file(
cx.background_executor(),
fs,
copilot_chat_config_path().clone(),
);

If the github-copilot directory does not exist, then attempting to add a watch for a file in a directory that does not exist will generate an error. I believe this is also impacting Windows users as well. The MacOS implementation of watch appears unaffected.

zed/crates/fs/src/fs.rs

Lines 524 to 525 in f5124c2

#[cfg(target_os = "macos")]
async fn watch(

@notpeter
Copy link
Member

I believe this was fixed by:

More info here

If you are still seeing this in your logs with a current release, please comment with more details and I'm happy to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] copilot AI feedback for Copilot inline completion Umbrella label for Copilot, Supermaven, etc. completions linux windows
Projects
No open projects
Development

No branches or pull requests

5 participants