Migrate claude_code profile rule UUIDs to deterministic builtin: format#995
Open
0x0079 wants to merge 2 commits into
Open
Migrate claude_code profile rule UUIDs to deterministic builtin: format#9950x0079 wants to merge 2 commits into
0x0079 wants to merge 2 commits into
Conversation
…le rules
Rules created under a claude_code profile previously got random UUIDs,
which made them impossible to reference, lock, or migrate reliably.
Switch to a deterministic format mirroring the Claude Desktop pattern:
builtin:claude_code:{profileID}:{cc|default|haiku|sonnet|opus|subagent}
- newCCProfileRules now generates UUIDs from profileID + RequestModel.
- migrate20260519 rewrites existing profile rules to the new format:
* 1 rule -> unified, UUID becomes :cc
* >=2 rules -> normalized to exactly 5 (default/haiku/sonnet/opus/subagent);
extras dropped, missing slots filled from a service-bearing sibling.
* Orphan rules (ProfileMeta gone) are migrated in place, not deleted.
- ProfileMeta.ID, profile names, frontend routes, and other builtin
constants are untouched.
migrate20260519 should only rewrite UUIDs and synthesize empty placeholder rules for missing slots — copying services from a sibling rule conflated the migration with user-facing configuration. Newly created rules now match newCCProfileRules behavior: empty services for the user to set.
1a331b8 to
5c6c7d6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a data migration (2026-05-19) that rewrites claude_code profile rule UUIDs from random UUIDs to a deterministic
builtin:claude_code:{profileID}:{model}format. It also updates the rule creation logic to use this deterministic format for new profiles.Key Changes
New migration function
migrate20260519(): Processes all claude_code profile rules and:builtin:claude_code:{profileID}:ccUpdated
newCCProfileRules(): Now acceptsprofileIDparameter and generates rules with deterministic UUIDs instead of random ones, enabling consistent rule identification and migrationComprehensive test coverage: Added 8 test cases covering:
Implementation Details
Migrate()flow and automatically saves config on changeshttps://claude.ai/code/session_01UxrWbxE84Yyg6GC9Dx3huE