Skip to content

refactor(tui): migrate app into core and bootstrap wiring#5

Merged
creatang merged 73 commits into
codex/tui-split-03-core-supportfrom
codex/tui-split-04-core-app-bootstrap-cleanup
Apr 10, 2026
Merged

refactor(tui): migrate app into core and bootstrap wiring#5
creatang merged 73 commits into
codex/tui-split-03-core-supportfrom
codex/tui-split-04-core-app-bootstrap-cleanup

Conversation

@creatang
Copy link
Copy Markdown
Owner

@creatang creatang commented Apr 7, 2026

背景:完成 internal/tui 从扁平单包到分层结构的主迁移闭环。
本次改动:
将原扁平 internal/tui/.go 迁入 internal/tui/core/app/
新增 internal/tui/bootstrap/* 完成依赖注入装配。
保留 internal/tui/tui.go 作为兼容入口。
删除迁移后冗余旧文件(保持功能不变)。
同步完成若干一致性收敛:
runtime 事件处理注册表化(替代巨型 switch 部分逻辑)
RuntimeClosedMsg 状态重置完善
panelOrder 去重
Activity 使用统一 state.ActivityEntry(保留 IsError)
工具函数重复定义清理
影响范围:仅 internal/tui。
验证:
go test ./internal/tui/... ./internal/app
风险与回滚:
中风险(迁移量较大);按堆叠 PR 顺序可安全回滚。

creatang and others added 8 commits April 6, 2026 21:04
- Fix NUL byte check in services/file_service.go (Linux filepath.Abs does not error on NUL)
- Set explicit width/height in TestAppHelpersAndRenderingSmoke to prevent header wrap
- Relax shell menu newline assertion on Windows for CJK path wrapping
- Increase workspace command executor timeout from 5s to 15s
- Add comprehensive tests for runtime_bridge parsing functions (services: 48% -> 95%)
- Add DefaultWorkspaceCommandExecutor and edge case tests (infra: 65% -> 87%)
fix(tui): fix CI failures and boost test coverage above 80%
@creatang creatang force-pushed the codex/tui-split-03-core-support branch from 5bdc898 to c2fa334 Compare April 8, 2026 00:51
Yumiue and others added 21 commits April 8, 2026 10:13
…-core-support

refactor(tui): add core command status and workspace helpers
feat: 新增 token 计量与自动压缩触发能力
# Conflicts:
#	internal/runtime/runtime.go
引入 Cobra CLI 根命令,并新增 --workdir 启动参数。

将 Windows UTF-8 控制台初始化前置到 CLI 与 TUI 共用启动路径,保证中文路径与中文输出兼容。

会话存储目录切换为 ~/.neocode/projects/<workspace-hash>/sessions,并保持 session.Workdir 仅表示运行目录。

补充工作区路径规范化、中文路径分桶、启动覆盖与相关回归测试,同时更新 README 与文档说明。
引入 Cobra CLI 根命令,并新增 --workdir 启动参数。

将 Windows UTF-8 控制台初始化前置到 CLI 与 TUI 共用启动路径,保证中文路径与中文输出兼容。

会话存储目录切换为 ~/.neocode/projects/<workspace-hash>/sessions,并保持 session.Workdir 仅表示运行目录。

补充工作区路径规范化、中文路径分桶、启动覆盖与相关回归测试,同时更新 README 与文档说明。
@creatang creatang force-pushed the codex/tui-split-04-core-app-bootstrap-cleanup branch from d643318 to 0e4af34 Compare April 9, 2026 14:53
creatang and others added 25 commits April 9, 2026 23:09
…-emitter

fix(tools): 重构 EmitChunk 错误传播与调用语义
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Yumiue <188874804+Yumiue@users.noreply.github.com>
…t, rate-limit misclassification

- runtime.go: decrement attempt before reactive-compact continue so the
  retry does not consume a MaxLoops slot (fixes max_loops=1 case)
- compact.go: reset TokenInputTotal/TokenOutputTotal on session before
  saving after compact, preventing stale high totals from being restored
  on the next run
- errors.go: guard text-based context_too_long override to only apply for
  generic client errors (ErrorCodeClient); 429 rate-limit errors whose
  message contains token-count fragments are no longer mis-routed into
  the reactive-compact path; same guard added in IsContextTooLong
- errors_test.go: add regression cases for the 429-with-token-count-message
  scenarios in NewProviderErrorFromStatus and IsContextTooLong

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Yumiue <188874804+Yumiue@users.noreply.github.com>
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Yumiue <188874804+Yumiue@users.noreply.github.com>
…e-146-1775790664

feat(runtime): recover with reactive compact on context-too-long
…-ask-select-closure

feat(tui/runtime): 补齐权限 ask 的选择式闭环(上下选择 + Enter确认)
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: minorcell <120795714+minorcell@users.noreply.github.com>
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
…e-213-1775793526

fix(runtime/tools): 收敛 EmitChunk 遗留 review 问题
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: minorcell <120795714+minorcell@users.noreply.github.com>
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: creatang <165447160+creatang@users.noreply.github.com>
@creatang creatang merged commit 42c834d into codex/tui-split-03-core-support Apr 10, 2026
1 check passed
creatang pushed a commit that referenced this pull request Apr 15, 2026
fix(review): preserve cleanup semantics and error contracts
creatang pushed a commit that referenced this pull request Apr 22, 2026
fix: harden gateway runtime migration reliability
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.

7 participants