refactor(tui): 收敛启动链中的重复安全初始化逻辑#56
Merged
minorcell merged 1 commit into1024XEngineer:mainfrom Mar 25, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
phantom5099
added a commit
that referenced
this pull request
Apr 23, 2026
fix(runtime): compact count only increments on applied compact
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
收敛 TUI 启动链中的重复安全初始化逻辑。
本次修改
PrepareWorkspace(...)中的安全初始化cmd/tui/main.go中重复的initializeSecurity(...)调用修改原因
之前的启动流程中,安全模块会被初始化两次:
PrepareWorkspace(...)内部已经完成一次初始化cmd/tui/main.go中又重复初始化了一次虽然这不会立即导致功能错误,但会让启动生命周期职责不够清晰,也会增加后续维护成本。
验证
已通过以下测试:
go test ./cmd/tui ./internal/tui/bootstrapgo test ./...Closes #54