Skip to content

Self-heal stale managed presets on queue rename / slot re-point - #34

Merged
hyperion-001 merged 1 commit into
mainfrom
claude/sillytavern-roulette-release-byri0z
Aug 19, 2026
Merged

Self-heal stale managed presets on queue rename / slot re-point#34
hyperion-001 merged 1 commit into
mainfrom
claude/sillytavern-roulette-release-byri0z

Conversation

@hyperion-001

Copy link
Copy Markdown
Contributor

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.

ensureManagedPreset now deletes the preset a slot previously owned whenever its derived name has changed, before saving the new one:

  • scans every supported API's preset manager, since a re-pointed slot's stale preset may live under a different API than the slot's current profile;
  • gated on the manager actually listing the name — ST's deletePreset on a keyed API splices by indexOf, 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

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
@hyperion-001
hyperion-001 merged commit 46568fd into main Aug 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants