@liuyoumi/codex-history 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.en.md +2 -0
- package/README.md +2 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.en.md
CHANGED
|
@@ -170,6 +170,8 @@ codex-history purge --cwd /Users/me/Projects/example --force
|
|
|
170
170
|
|
|
171
171
|
`--force` skips only interactive confirmation. It still keeps schema validation, active-thread protection, and post-purge verification.
|
|
172
172
|
|
|
173
|
+
During deletion, `.codex-global-state.json` and `.codex-global-state.json.bak` are structurally rewritten to remove global-state keys that contain the target thread id, such as composer draft keys stored as `local:<threadId>`.
|
|
174
|
+
|
|
173
175
|
### `purge-orphans`
|
|
174
176
|
|
|
175
177
|
Remove orphaned local data: conversations whose `state_5.sqlite.threads.rollout_path` points to a missing session or archived session file, and logs-only records that remain in `logs_2.sqlite.logs` without a matching thread in the `threads` table.
|
package/README.md
CHANGED
|
@@ -170,6 +170,8 @@ codex-history purge --cwd /Users/me/Projects/example --force
|
|
|
170
170
|
|
|
171
171
|
`--force` 只跳过交互确认,不会跳过数据结构校验、active thread 保护和删除后的验证。
|
|
172
172
|
|
|
173
|
+
删除时会结构化重写 `.codex-global-state.json` 和 `.codex-global-state.json.bak`,移除包含目标 thread id 的全局状态键,例如输入草稿缓存里的 `local:<threadId>`。
|
|
174
|
+
|
|
173
175
|
### `purge-orphans`
|
|
174
176
|
|
|
175
177
|
清理本地孤儿数据:包括 `state_5.sqlite.threads.rollout_path` 指向的 session / archived session 文件已经不存在的对话,以及只残留在 `logs_2.sqlite.logs` 中、但 `threads` 表里已经没有对应 thread 的日志记录。
|
package/dist/cli.js
CHANGED
|
@@ -580,7 +580,7 @@ function removeThreadReferences(value, threadId) {
|
|
|
580
580
|
let changed = false;
|
|
581
581
|
const next = {};
|
|
582
582
|
for (const [key, child] of Object.entries(value)) {
|
|
583
|
-
if (key
|
|
583
|
+
if (key.includes(threadId)) {
|
|
584
584
|
changed = true;
|
|
585
585
|
continue;
|
|
586
586
|
}
|