Skip to content

ep: Fix panic when switching to a non-store provider#49698

Merged
osyvokon merged 1 commit intomainfrom
ep-fix-unreachable-crash
Feb 20, 2026
Merged

ep: Fix panic when switching to a non-store provider#49698
osyvokon merged 1 commit intomainfrom
ep-fix-unreachable-crash

Conversation

@osyvokon
Copy link
Copy Markdown
Contributor

The unreachable() assumption at queue_prediction_refresh could be violated by an async race condition:

  1. request_prediction_internal spawns an async task
  2. The task awaits a prediction request
  3. If the prediction returns None, it calls queue_prediction_refresh
  4. Between the time the prediction was initiated (when the provider was an EP-store provider) and when the async callback runs, the user can change their edit prediction provider setting to a non-EP-store provider
  5. queue_prediction_refresh re-reads the settings and hits the `unreachable!()

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 20, 2026
@osyvokon osyvokon enabled auto-merge (squash) February 20, 2026 09:35
@zed-community-bot zed-community-bot bot added the staff Pull requests authored by a current member of Zed staff label Feb 20, 2026
@osyvokon osyvokon disabled auto-merge February 20, 2026 09:37
@osyvokon osyvokon merged commit fb82b11 into main Feb 20, 2026
52 of 53 checks passed
@osyvokon osyvokon deleted the ep-fix-unreachable-crash branch February 20, 2026 09:46
maxbrunsfeld pushed a commit that referenced this pull request Feb 27, 2026
The `unreachable()` assumption at `queue_prediction_refresh` could be
violated by an async race condition:

1. `request_prediction_internal` spawns an async task
2. The task awaits a prediction request
3. If the prediction returns `None`, it calls `queue_prediction_refresh`
4. Between the time the prediction was initiated (when the provider was
an EP-store provider) and when the async callback runs, the user can
change their edit prediction provider setting to a non-EP-store provider
5. `queue_prediction_refresh` re-reads the settings and hits the
`unreachable!()

Release Notes:

- N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant