fix: replace mock API with real SillyTavern context — tested end-to-end#1
Open
LiweiDonVee wants to merge 2 commits into
Open
fix: replace mock API with real SillyTavern context — tested end-to-end#1LiweiDonVee wants to merge 2 commits into
LiweiDonVee wants to merge 2 commits into
Conversation
Root cause: generateRaw() was hardcoded to return JSON.stringify({entries:[]})
in both the original and X00LA fork. The extension never called any LLM.
Changes:
- Replace broken webpack build with plain IIFE, loaded via <script src>
- Use SillyTavern.getContext().generateRaw() for real API calls
- Replace non-existent world_info.sync() with ctx().saveWorldInfo()
- Implement multi-keyword scoring (>=2 match threshold) for WI matching
- Add system prompt rule to prevent parent keyword pollution in child entries
- Remove 3.6MB dist/ artifact, broken webpack config, unused src/
Tested end-to-end with DeepSeek V4 Flash — correctly extracts characters,
locations, objects, and events from chat conversations and writes them
as valid SillyTavern World Info entries.
Fixed-by: Julian (DeepSeek V4 Pro)
Original-by: AugieIsHere (Claude 3.7 Sonnet)
Fork-by: X00LA (Claude 3.5 Sonnet)
Changed Files
|
Bugs fixed (code-review with find-bugs + code-review skills): HIGH: - Race condition: add `analyzing` guard + await lock to prevent concurrent generateRaw() calls from onMessage/slash-command - applyEntry could write to wrong WI book when multiple books existed — now uses created book directly instead of re-scanning MEDIUM: - XSS: all dynamic content in buildCard now escaped via esc() (AI-generated name/content/reason went directly into innerHTML) - mergeKeys: String(null) produced literal "null" keyword - getCurrentWIData: warns when multiple books exist without target LOW: - buildCard crash on null oldContent.slice() - Loading indicator with spinner + button disable during analysis - UI IDs namespaced (dl_* → dynamiclore_*) to prevent collisions Fixed-by: Julian (DeepSeek V4 Pro)
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.
What happened
The extension never worked. In both the original (AugieIsHere) and this fork (X00LA), the core function was hardcoded to return empty results — it never called any LLM.
Root cause
In both versions,
src/dynamicLore.jscontains:Combined with a broken webpack build (invalid externals map for SillyTavern's module system), the extension produced zero results.
Changes
Testing
End-to-end tested with DeepSeek V4 Flash against a 10-message conversation. Correctly extracted 4 entries (2 new characters, 1 location, 1 artifact), matched 2 updates to existing WI entries, and wrote valid SillyTavern World Info entries.
Stats
14 files changed, +601 / -4046 lines (removed 3.6MB dist/ artifact, broken webpack, unused src/)
Credits