Skip to content

fix: handle Tauri cold storage path and remote persistence#1468

Open
gwahak10 wants to merge 1 commit into
kwaroran:mainfrom
gwahak10:fix/tauri-coldstorage-appdata
Open

fix: handle Tauri cold storage path and remote persistence#1468
gwahak10 wants to merge 1 commit into
kwaroran:mainfrom
gwahak10:fix/tauri-coldstorage-appdata

Conversation

@gwahak10
Copy link
Copy Markdown
Contributor

@gwahak10 gwahak10 commented Jun 3, 2026

PR Checklist

  • Required Checks
    • Have you added type definitions?
    • Updated internal helper return types to Promise<boolean>. No new public type definitions were needed.
    • Have you tested your changes?
    • Have you checked that it won't break any existing features?
  • If your PR uses models1, check the following:
    • Have you checked if it works normally in all models?
    • Have you checked if it works normally in all web, local, and node-hosted versions? If it doesn't, have you blocked it in those versions?
  • If your PR is highly AI generated2, check the following:
    • Have you understood what the code does?
    • Have you cleaned up any unnecessary or redundant code?
    • Is it not a huge change?
      • We currently do not accept highly AI generated PRs that are large changes.

Summary

Tauri cold storage의 AppData 경로 처리와 local remote character block persistence 문제를 수정합니다.

This PR fixes Tauri cold storage AppData path handling and local remote character block persistence.

Related Issues

None.

Changes

한국어

  • Tauri cold storage 저장 시 exists('./coldstorage')에 의존하지 않고, mkdir('./coldstorage', { recursive: true, baseDir: BaseDirectory.AppData })를 항상 호출하도록 변경했습니다.
  • Tauri cold storage cleanup에서 remove() 호출에도 BaseDirectory.AppData를 추가했습니다.
  • cold storage 변환으로 캐릭터 또는 채팅이 실제로 변경되었는지 추적하기 위해 makeColdDataForCharacter()makeColdDataForChat()Promise<boolean>을 반환하도록 변경했습니다.
  • 실제 cold storage 변환이 발생한 경우 requiresFullEncoderReload.state = true를 설정하여 다음 저장 시 local remote character blocks가 다시 기록되도록 했습니다.

English

  • Removed reliance on exists('./coldstorage') in the Tauri cold storage writer and always create the directory with mkdir('./coldstorage', { recursive: true, baseDir: BaseDirectory.AppData }).
  • Added BaseDirectory.AppData to the Tauri cold storage cleanup remove() call.
  • Changed makeColdDataForCharacter() and makeColdDataForChat() to return Promise<boolean> so makeColdData() can track whether cold storage actually changed any character/chat data.
  • When cold storage conversion actually changes data, set requiresFullEncoderReload.state = true so local remote character blocks are rewritten on the next save.

Impact

한국어

이 수정은 Tauri 환경에서 cold storage가 process working directory에 의존해 실패하는 문제를 줄이고, cold storage 변환 후 local remote character block에 cold stub이 저장되지 않아 다음 실행 시 같은 캐릭터가 다시 cold storage 처리되는 문제를 방지하기 위한 것입니다.

웹, account storage, node-hosted storage의 cold storage 저장 경로는 변경하지 않았습니다. 변경된 동작은 주로 Tauri local storage와 local remote character block persistence에 해당합니다.

English

This change should prevent Tauri cold storage from depending on the process working directory, and should also prevent the same characters from being cold-stored again on the next launch because converted cold stubs were not persisted into local remote character blocks.

Cold storage path handling for web, account storage, and node-hosted storage is not changed. The behavior change mainly affects Tauri local storage and local remote character block persistence.

Testing

한국어

  • pnpm check 통과:

    • svelte-check found 0 errors and 0 warnings
  • Windows Tauri 릴리즈 빌드에서 DevTools로 문제를 재현하고 확인했습니다.

  • 일반 실행 시 cold storage 저장이 실패하고, WorkingDirectory를 %APPDATA%\co.aiclient.risu로 지정하면 저장이 시작되는 것을 확인했습니다.

  • cold storage 완료 시점에 full encoder reload 플래그를 강제로 설정했을 때, local remote character block에 cold stub이 반영되고 다음 실행 시 중복 cold storage 생성이 멈추는 것을 확인했습니다.

  • 성공 적용 후 JS heap이 약 3GB대에서 약 1,153MB까지 감소하는 것을 확인했습니다.

English

  • pnpm check passed:

    • svelte-check found 0 errors and 0 warnings
  • Reproduced and verified the issue with DevTools on the released Windows Tauri build.

  • Confirmed that cold storage fails when launched normally, but starts writing when WorkingDirectory is set to %APPDATA%\co.aiclient.risu.

  • Confirmed that forcing the full encoder reload flag after cold storage conversion persists cold stubs into local remote character blocks and prevents duplicate cold storage generation on the next launch.

  • Confirmed JS heap decreased from around 3GB to about 1,153MB after successful persistence.

Additional Notes

한국어

이 PR은 AI model 요청/응답 처리 로직을 변경하지 않습니다.

수정 범위는 src/ts/process/coldstorage.svelte.ts에 한정되어 있으며, cold storage 변환 후 실제 변경이 있었을 때만 full encoder reload를 요청하도록 했습니다.

DevTools로 직접 디버깅하고 검증한 결과를 바탕으로 작성했습니다. 변경 범위는 작고, 제출 전 수정 내용을 확인했습니다.

English

This PR does not modify AI model prompting, request handling, or response handling.

The change is limited to src/ts/process/coldstorage.svelte.ts, and full encoder reload is requested only when cold storage conversion actually changed character/chat data.

Based on manual debugging and verification with DevTools. The code change is small and was reviewed before submission.

Footnotes

  1. Modifies the behavior of prompting, requesting, or handling responses from AI models.

  2. Over 80% of the code is AI generated.

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.

1 participant