Repository navigation
Conversation
SameDesu123
approved these changes
Sep 16, 2025
Owner
|
Hold due to #998 |
cubicj
reviewed
Jul 12, 2026
cubicj
left a comment
Collaborator
There was a problem hiding this comment.
I traced why onButtonClick persisted while onStart and onOutput didn't. In the trigger path the engine works on a cloned chat, and that clone is what gets saved back afterwards, while the old code wrote to a separate clone of char that nothing reads again. So ScriptingEngineState.chat is the object that actually gets saved, and the #1041 cases hold up. pnpm check, pnpm test, and pnpm build pass locally with this applied on the current main.
The description also lists onInput, but that path saves only message from the returned chat, so an upsert from onInput is still lost. Could you check that case?
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.
PR Checklist
Description
Fixes the issue where
upsertLocalLoreBookfunction doesn't persist changes when called fromonStart,onInputandonOutputevents.Changes Made
upsertLocalLoreBookinscriptings.tsto useScriptingEngineState.chatinstead ofchar.chats[char.chatPage]Cause
The function was modifying a different chat object reference than the one being returned by the scripting engine, causing changes to be lost in
onStart/onOutputcontexts.Testing
upsertLocalLoreBooknow works inonStarteventsupsertLocalLoreBooknow works inonOutputeventsonButtonClickfunctionality remains intactFiles Changed
src/ts/process/scriptings.tsFixes #1041
(KR) 설명
onStart와onInput,onOutput이벤트에서upsertLocalLoreBook함수가 변경사항을 저장하지 않는 문제를 수정했습니다.변경사항
scriptings.ts의upsertLocalLoreBook을char.chats[char.chatPage]대신ScriptingEngineState.chat을 사용하도록 수정원인
함수가 스크립팅 엔진에서 반환하는 채팅 객체와 다른 채팅 객체 참조를 수정하고 있어서,
onStart/onOutput컨텍스트에서 변경사항이 손실되었음.테스트
upsertLocalLoreBook이 이제onStart이벤트에서 정상 작동하는 것을 확인upsertLocalLoreBook이 이제onOutput이벤트에서 정상 작동하는 것을 확인onButtonClick기능이 그대로 유지되는 것을 확인변경된 파일
src/ts/process/scriptings.tsFixes #1041