Skip to content

Restore access to old threads that mention rules - #58560

Merged
MartinYe1234 merged 8 commits into
mainfrom
martin/ai-371-preview-data-loss-in-old-threads-mentioning-rules
Jun 4, 2026
Merged

Restore access to old threads that mention rules#58560
MartinYe1234 merged 8 commits into
mainfrom
martin/ai-371-preview-data-loss-in-old-threads-mentioning-rules

Conversation

@MartinYe1234

@MartinYe1234 MartinYe1234 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Removing the Rule variant from MentionUri in #58080 broke deserialization of any thread saved before the rules-to-skills migration. Loading one failed with unknown variant Rule``, making those threads inaccessible.

This restores access without bringing back the rules feature:

  • Reintroduce a backward-compatible Rule mention variant so legacy threads deserialize again.
  • Preserve the original rule id through save/load so a thread re-saved by a newer build still loads on older Zed versions (and synthesize a valid placeholder when the id is missing).
  • Clicking a legacy rule mention now opens the skill the rule was migrated into, and shows a notification linking the Skills docs. On remote/collab projects the migrated file lives on the local machine, so it opens as a read-only buffer. If no matching skill exists, it does nothing.

Closes #58498
Closes AI-371

Release Notes:

  • Fixed old threads that mention Rules being inaccessible after Rules were migrated to Skills

Removing the Rule variant from MentionUri broke deserialization of
threads saved before rules were removed, making those threads
inaccessible. Re-add a minimal, self-contained Rule variant so old
threads still load; serde ignores the now-removed id field.
The previous fix dropped the rule id field, so re-saved threads could
no longer be loaded by older Zed versions that still require it. Keep
the id verbatim through serialization, and synthesize a valid
placeholder when it is missing, so threads load on any version.
Clicking a legacy rule mention did nothing since the rules UI was
removed. Instead, open the skill file the rule was migrated into (when
it exists) and show a toast letting the user know rules are now skills.
Migrated skills always live in the local global skills dir, but
open_abs_path resolves against the active project, which fails on
remote/collab projects. Resolve the file against the local filesystem:
open the editable file on local projects, and show a read-only local
buffer on remote/collab. Native path joins keep this correct on
Windows.
@MartinYe1234 MartinYe1234 self-assigned this Jun 4, 2026
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 4, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Jun 4, 2026
@MartinYe1234
MartinYe1234 marked this pull request as ready for review June 4, 2026 16:33
@MartinYe1234
MartinYe1234 added this pull request to the merge queue Jun 4, 2026
Merged via the queue into main with commit b53b14d Jun 4, 2026
33 checks passed
@MartinYe1234
MartinYe1234 deleted the martin/ai-371-preview-data-loss-in-old-threads-mentioning-rules branch June 4, 2026 16:56
TomPlanche pushed a commit to TomPlanche/zed that referenced this pull request Jun 8, 2026
Removing the `Rule` variant from `MentionUri` in zed-industries#58080 broke
deserialization of any thread saved before the rules-to-skills
migration. Loading one failed with `unknown variant `Rule``, making
those threads inaccessible.

This restores access without bringing back the rules feature:

- Reintroduce a backward-compatible `Rule` mention variant so legacy
threads deserialize again.
- Preserve the original rule `id` through save/load so a thread re-saved
by a newer build still loads on older Zed versions (and synthesize a
valid placeholder when the id is missing).
- Clicking a legacy rule mention now opens the skill the rule was
migrated into, and shows a notification linking the Skills docs. On
remote/collab projects the migrated file lives on the local machine, so
it opens as a read-only buffer. If no matching skill exists, it does
nothing.

Closes zed-industries#58498
Closes AI-371

Release Notes:

- Fixed old threads that mention Rules being inaccessible after Rules
were migrated to Skills
This was referenced Jun 18, 2026
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
Removing the `Rule` variant from `MentionUri` in zed-industries#58080 broke
deserialization of any thread saved before the rules-to-skills
migration. Loading one failed with `unknown variant `Rule``, making
those threads inaccessible.

This restores access without bringing back the rules feature:

- Reintroduce a backward-compatible `Rule` mention variant so legacy
threads deserialize again.
- Preserve the original rule `id` through save/load so a thread re-saved
by a newer build still loads on older Zed versions (and synthesize a
valid placeholder when the id is missing).
- Clicking a legacy rule mention now opens the skill the rule was
migrated into, and shows a notification linking the Skills docs. On
remote/collab projects the migrated file lives on the local machine, so
it opens as a read-only buffer. If no matching skill exists, it does
nothing.

Closes zed-industries#58498
Closes AI-371

Release Notes:

- Fixed old threads that mention Rules being inaccessible after Rules
were migrated to Skills
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
Removing the `Rule` variant from `MentionUri` in zed-industries#58080 broke
deserialization of any thread saved before the rules-to-skills
migration. Loading one failed with `unknown variant `Rule``, making
those threads inaccessible.

This restores access without bringing back the rules feature:

- Reintroduce a backward-compatible `Rule` mention variant so legacy
threads deserialize again.
- Preserve the original rule `id` through save/load so a thread re-saved
by a newer build still loads on older Zed versions (and synthesize a
valid placeholder when the id is missing).
- Clicking a legacy rule mention now opens the skill the rule was
migrated into, and shows a notification linking the Skills docs. On
remote/collab projects the migrated file lives on the local machine, so
it opens as a read-only buffer. If no matching skill exists, it does
nothing.

Closes zed-industries#58498
Closes AI-371

Release Notes:

- Fixed old threads that mention Rules being inaccessible after Rules
were migrated to Skills
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.

Data loss: old threads mentioning rules are now inaccessible

2 participants