Self-heal stale managed presets on queue rename / slot re-point - #34
Merged
Merged
Conversation
The managed-preset name embeds the queue name and slot profile, so renaming a queue (or re-pointing a tuned slot at a different profile) minted a fresh preset on the next switch and orphaned the old one in the user's preset list forever. ensureManagedPreset now deletes the preset a slot previously owned whenever its derived name has changed, before saving the new one — scanning every supported API's manager since a re-pointed slot's stale preset may live under a different API, and gated on the manager actually listing the name (deletePreset on a keyed API splices by indexOf and must not run for unknown names). Invariant after this change: a tuned slot owns at most one managed preset at any time; it is renamed-in-effect on queue rename, and removed on slot or queue deletion as before. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XDAj3aSdkvffKR6ZetqcyV
Merged
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.
Found during a storage-lifecycle audit: the managed-preset name embeds the queue name and slot profile, so renaming a queue (or re-pointing a tuned slot at a different profile) minted a preset under the new name on the next switch and orphaned the old
[Roulette] …entry in the user's preset list forever.ensureManagedPresetnow deletes the preset a slot previously owned whenever its derived name has changed, before saving the new one:deletePreseton a keyed API splices byindexOf, so it must never run for a name the manager doesn't hold.Resulting invariant: a tuned slot owns at most one managed preset at any time — effectively renamed on queue rename, and removed on slot/queue deletion exactly as before.
The rest of the audit (state-change listeners, popup DOM, dot-strip rebuilds, pick-history cap, character-binding pruning) found everything bounded; this was the only accumulation path.
Tests: 15/15 pass (
npm test).🤖 Generated with Claude Code
https://claude.ai/code/session_01XDAj3aSdkvffKR6ZetqcyV
Generated by Claude Code