Skip to content

feat(tui): resume 恢复历史时同时恢复当时的 UI 状态,而不仅是消息内容 #224

Description

@minorcell

现状

handleHistorySelect(App.tsx)从 history.log resume 一个历史会话时,只恢复了:

  • 消息内容(pendingHistoryMessages
  • summary 系统消息(appendSystemMessage('History', ...)
  • 时间线 turns(用于渲染)

其余 UI 状态全部回到默认值(新建会话时的初始值),看起来"简陋"。

期望

resume 历史会话时,同时恢复该会话当时的 UI 状态:

现有基础

  • session_start 事件已经携带 metamodecwdcontextWindowtoolPermissionModewarnPromptTokensautoCompactThresholdPercent(core/agent/loop.ts:499)
  • history_parser.ts:291 已解析 session_start.meta.cwd,可继续扩展解析其余字段
  • 缺失字段(provider/model、thinking、折叠状态)需要先在事件 meta 里补充记录

验收标准

  1. resume 后底部栏 / composer 显示的历史会话 provider、model、context limit 与当时一致
  2. tool permission mode、thinking 开关恢复
  3. 渲染状态合理(折叠还原或回到底部),不再只是默认新建状态

Metadata

Metadata

Assignees

Labels

area:coreCore runtime and session statearea:securityApproval, sandbox, and security policyarea:toolsBuilt-in tools and tool runtimearea:tuiTerminal UI and interaction layerenhancementNew feature or requestneeds-triageIssue needs initial triage

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions