# copilot: Fix onboarding into Copilot requires Zed restart \(\#26330\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/f14d6670bace8a6703433be49cef582523822935)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: f14d6670bace8a6703433be49cef582523822935

Requested commit: f14d6670bace8a6703433be49cef582523822935

Commit: f14d6670bace8a6703433be49cef582523822935

Tree: e0a8484d9a5c80f7e79b69aa91b495095833e0e9

Author: Smit Barmase

Committer: GitHub

## Message

```
copilot: Fix onboarding into Copilot requires Zed restart (#26330)

Closes #25594

This PR fixes an issue where signing into Copilot required restarting
Zed.

Copilot depends on an OAuth token that comes from either `hosts.json` or
`apps.json`. Initially, both files don't exist. If neither file is
found, we fallback to watching `hosts.json` for updates. However, if the
auth process creates `apps.json`, we won't receive updates from it,
causing the UI to remain outdated.

This PR fixes that by watching the parent `github-copilot` directory
instead, which will always contain one of those files along with an
additional version file.

I have tested this on macOS and Linux Wayland.

Release Notes:

- Fixed an issue where signing into Copilot required restarting Zed.
```

## Parents

- [22d9b5d8ca6e1d7ed868abcc8ba81098e2ef6da9](https://git.cafe/gitcafe/zed/commit/22d9b5d8ca6e1d7ed868abcc8ba81098e2ef6da9?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/f14d6670bace8a6703433be49cef582523822935?format=markdown)
