Skip to content

perf(frontend): 优化长会话同步与首屏加载 - #280

Merged
Qiyuanqiii merged 1 commit into
mainfrom
codex/issue-260-long-conversation-performance
Oct 5, 2026
Merged

Qiyuanqiii merged 1 commit into
mainfrom
codex/issue-260-long-conversation-performance

Conversation

@Qiyuanqiii

Copy link
Copy Markdown
Member

Fixes #260

Summary

长会话加载多页历史后,后台同步原先会反复读取全部历史;首屏也静态引入了尚未打开的高级界面。本次把最新持久记录同步与手动历史分页分开,并让高级模块在首次打开时加载。

  • 使用原有来源身份和 opaque cursor 补齐、去重、排序。稳定历史保留;旧窗口中的排队消息、Run 边界和运行中命令摘要按来源窗口定向更新,处理读取期间的终态、暂隐和迟到历史页。
  • 空/重复 Desktop 事件页复用状态,Web SSE 在连接验证成功时报告已连接;合并事件刷新并降低健康连接下的兜底频率,保留重连、审批和最终落盘同步。
  • 稳定历史行与活动输出分开投影和渲染,历史页插入完成后恢复阅读锚点,保留任务切回位置。
  • 延迟加载设置、Inspector 和审阅,提取共享 PlanDeliveryPanel 与密度偏好,拆分功能 CSS;局部加载失败保留导航及草稿。保留 Monaco 动态加载及官方完整 TTF。
  • 已更新到最新 main f33ceebd,完整保留 [P1] feat(frontend): 简化首次模型接入 #265 的模型接入行为与固定操作栏。

同一 Node 24.14.0、lockfile 和 Vite 8.2.1 下,按 manifest 递归累计全部初始静态依赖:

指标 main 基线 本次修改
10 页稳定历史的一次刷新请求 10 1
首屏 JS gzip 572,314 B 319,637 B(-44.2%)
首屏 CSS gzip 56,331 B 47,432 B(-15.8%)

可变来源窗口会增加必要补读;字体不计入上述 JS/CSS 比例。1,000 条历史加一条活动输出,20 次输出更新仅增加 20 次 Markdown 渲染。测量方式、隐藏来源恢复的限制与完整验证范围见 性能记录。

Validation

  • npm run check:api
  • npm test -- --maxWorkers=4:169 个文件、1,520 项测试通过
  • npm run build -- --manifest(含 TypeScript 检查)
  • npm audit --audit-level=high:0 vulnerabilities
  • go test -count=1 ./internal/webui
  • go test -count=1 -tags desktop ./web
  • go test -count=1 -tags "desktop,wv2runtime.error" ./cmd/cyberagent-desktop ./internal/desktop ./internal/webui
  • 相对 main 的 CSS 语义核对:1,017 条 selector/声明/条件上下文记录一致,同 selector 内顺序不变
  • git diff --check

本地 Go 为 1.26.5;CI 沿用仓库固定的 Go 1.25.x。完整 go test ./...、go vet ./... 和 Rust 全量检查未在本地运行:本次仅改前端与使用文档,沿用现有适用 CI,不增加重复门禁。未执行真实模型任务。

Surface governance

  • No Surface is added, promoted, downgraded, deprecated, or removed.

Registry、tier/transition、entry criteria、owner、platforms、compatibility、deprecation/removal declarations: N/A — no Surface change. 沿用 ADR 0134 和现有 Go Application transcript/approval 合同,无新增 authority。

Audit

  • No credentials or local runtime data are included.
  • Policy, workspace, sandbox, and persistence boundaries were reviewed. 只调整现有只读同步与界面加载;没有新增权限、执行路径、凭证、后端持久化或协议字段,既有 mutation 及审批边界保持。
  • Project memory and usage documentation were updated, with reproducible measurements and verification limits.

@Qiyuanqiii
Qiyuanqiii merged commit f342d3d into main Oct 5, 2026
13 checks passed
@Qiyuanqiii
Qiyuanqiii deleted the codex/issue-260-long-conversation-performance branch October 5, 2026 17:11
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.

[P1] perf(frontend): 优化长会话同步与首屏加载

1 participant