Skip to content

Commit 9368e68

Browse files
committed
v4.0.4-beta.5: 移除 config.toml hooks.state 段——Codex 0.145.0 起信任由内部数据库管理
- 移除 buildManagedHookTrustEntries、syncHookStateSections 等所有 hooks.state 生成逻辑 - 移除 syncCodexHookTrust 及 update 流程中的信任哈希同步 - installCodexManagedConfig 简化为仅管理 top-level 键和 features/tui 段 - 用户首次安装后手动信任 hooks 一次即持久生效(Codex 内部存储)
1 parent 1e5c9d1 commit 9368e68

2 files changed

Lines changed: 11 additions & 219 deletions

File tree

src/cli/install.mjs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { ensureDir, fileExists, readJson, readText, removePath, writeTextAtomic
1515
import { appDir, helloagentsRoot, toPosix } from '../kernel/paths.mjs'
1616
import { injectKernel, readKernelText, removeKernel } from '../hosts/carriers.mjs'
1717
import { backupCodexConfig, removeCodexBackups } from '../hosts/codex-backup.mjs'
18-
import { installCodexManagedConfig, syncCodexHookTrust, uninstallCodexManagedConfig } from '../hosts/codex-config.mjs'
18+
import { installCodexManagedConfig, uninstallCodexManagedConfig } from '../hosts/codex-config.mjs'
1919
import { installCodexHooks, uninstallCodexHooks } from '../hosts/codex-hooks.mjs'
2020
import { removeCursorHooks, removeSettingsHooks, upsertCursorHooks, upsertSettingsHooks } from '../hosts/hooks-config.mjs'
2121
import {
@@ -167,7 +167,7 @@ function installHostStandard(ctx, host, kernel) {
167167
backupCodexConfig(ctx.home, configPath)
168168
const hooksPath = join(ctx.home, '.codex', 'hooks.json')
169169
const hooksData = readJson(hooksPath)
170-
installCodexManagedConfig(configPath, hooksPath, hooksData, join(helloagentsRoot(ctx.home), 'backups', 'codex'))
170+
installCodexManagedConfig(configPath, join(helloagentsRoot(ctx.home), 'backups', 'codex'))
171171
} catch (error) {
172172
ctx.log(ctx.t('install.codexExtrasFailed', { message: error instanceof Error ? error.message : String(error) }))
173173
}
@@ -350,13 +350,7 @@ export function runUpdate(ctx, allHosts) {
350350

351351
// 更新 Codex 信任哈希
352352
if (host.id === 'codex' && state.hosts[host.id]?.mode === 'standard') {
353-
try {
354-
const hooksPath = join(ctx.home, '.codex', 'hooks.json')
355-
const hooksData = readJson(hooksPath)
356-
if (hooksData) {
357-
syncCodexHookTrust(String(host.codexConfigPath(ctx.home)), hooksPath, hooksData)
358-
}
359-
} catch { /* 非关键 */ }
353+
// Codex 0.145.0 起信任由内部数据库管理,不再需要写入 config.toml
360354
}
361355

362356
if (state.hosts[host.id]?.mode === 'global') {

0 commit comments

Comments
 (0)