Files
MooTool/next-compose/docs/diff/151-electron-runtime-drafts-import.md
RememBerBerandCursor f1d705753e fix(runtime): DIFF-506 对齐 Electron 运行参数长度规范化
Electron normalizeRuntimeOptions 对 arguments/workingDirectory 有上限;迁入与会话快照现统一截断,避免超长字段导致运行拒绝或脏 JSON。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 11:08:14 +08:00

1.3 KiB
Raw Permalink Blame History

DIFF-151:Electron runtime.drafts / runtime.options → 代码运行会话

背景

Electron mootool-next.json 的 settings.runtime 除可执行路径外,还在 drafts 与 options(arguments / workingDirectory)中保存四语言运行台草稿。DIFF-150 仅合并路径类 RuntimeSettings 字段;草稿仍留在 Electron 存储中,compose 代码运行会话(CodeRunSessionSnapshot / ToolId.Java 会话存储)未迁入。

行为

  • ElectronNextSettingsImport.loadCodeRunPatchFromStore 从 Electron 商店 JSON 解析 runtime.drafts 与 runtime.options。
  • mergeCodeRunSnapshots:导入侧非空字段覆盖当前会话对应字段;代码长度受 CodeRunEngine.MAX_CODE_BYTES 截断。
  • 跨产品导入确认后,在设置合并之后调用 AppContainer.mergeElectronCodeRunFromStore(electronStorePath) 并 persistCodeRun()。

证据

  • ElectronNextSettingsImportTest.loadsRuntimeDraftsAndOptionsIntoCodeRunPatch

仍未覆盖

  • 运行参数/工作目录与会话快照长度规范化见 DIFF-506。
  • SQLite t_func_content 写入工具会话见 DIFF-152;仍同时写入 history。
  • t_next_migration_run 逐行幂等与 safeStorage 密文迁移未做。