Skip to content

refactor(tui): 收敛启动链中的重复安全初始化逻辑#56

Merged
minorcell merged 1 commit into1024XEngineer:mainfrom
pionxe:tui-startup-init
Mar 25, 2026
Merged

refactor(tui): 收敛启动链中的重复安全初始化逻辑#56
minorcell merged 1 commit into1024XEngineer:mainfrom
pionxe:tui-startup-init

Conversation

@pionxe
Copy link
Copy Markdown
Collaborator

@pionxe pionxe commented Mar 25, 2026

概要

收敛 TUI 启动链中的重复安全初始化逻辑。

本次修改

  • 保留 PrepareWorkspace(...) 中的安全初始化
  • 删除 cmd/tui/main.go 中重复的 initializeSecurity(...) 调用
  • 补充 workspace 准备阶段的错误包装,使错误来源更清晰

修改原因

之前的启动流程中,安全模块会被初始化两次:

  1. PrepareWorkspace(...) 内部已经完成一次初始化
  2. cmd/tui/main.go 中又重复初始化了一次

虽然这不会立即导致功能错误,但会让启动生命周期职责不够清晰,也会增加后续维护成本。

验证

已通过以下测试:

  • go test ./cmd/tui ./internal/tui/bootstrap
  • go test ./...

Closes #54

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@minorcell minorcell merged commit 1f2591d into 1024XEngineer:main Mar 25, 2026
2 checks passed
@pionxe pionxe deleted the tui-startup-init branch March 28, 2026 06:57
phantom5099 added a commit that referenced this pull request Apr 23, 2026
fix(runtime): compact count only increments on applied compact
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.

refactor(tui): 收敛启动链中的重复安全初始化逻辑

2 participants