Skip to content

fix: sandbox 运行日志按时间排序并统一北京时间格式 - #42

Merged
eetoc merged 1 commit into
mainfrom
fix/sandbox-log-timeline-ordering
Aug 19, 2026
Merged

fix: sandbox 运行日志按时间排序并统一北京时间格式#42
eetoc merged 1 commit into
mainfrom
fix/sandbox-log-timeline-ordering

Conversation

@eetoc

@eetoc eetoc commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

问题

src/lib/components/sandbox-workbench.svelte 原来把三类日志数据当作三段独立字符串简单拼接:

  • combinedContextLog = context 日志(EventDetail 页面的 scheduler/LLM 网关原始日志)+ 实时 watch 输出
  • historyLog = sandbox 自身历史事件(含 sandbox.created)

combinedLog = [combinedContextLog, historyLog].join('\n')historyLog 永远排在最后,不管其真实发生时间早晚(sandbox.created 会显示在网关日志之后的直接原因)。

另外时区不一致:EventDetail.sveltesandboxLog() 用裸 ISO UTC 时间戳,sandbox-workbench 用北京时间。

修改

contextLog / liveContextLog / historyEvents 三个来源统一成带 createdAt 的结构化条目(EventTimelineItem),按时间排序后统一用北京时间(formatBeijingTime)渲染成一条真正的时间线。

  • src/routes/EventDetail.svelte: sandboxLog() 改为 sandboxLogEntries() 返回结构化数组
  • src/lib/components/sandbox-workbench.svelte: 接收 contextLogEntries,实时输出合成到达时间戳,统一排序 + 北京时间格式;日志条目保持紧凑单换行,与原有展示一致

验证

  • npm run check:ui / npm run lint:ui / prettier 通过

…rmatting

Merge scheduler/gateway context logs, live watch output, and sandbox history
events into one structured timeline sorted by createdAt, instead of string
concatenation that always placed history events last. Format every entry with
Beijing time so EventDetail and the workbench agree.

Co-Authored-By: Claude <noreply@anthropic.com>
@eetoc
eetoc marked this pull request as ready for review August 19, 2026 05:15
@eetoc
eetoc merged commit 890be26 into main Aug 19, 2026
1 check passed
@eetoc
eetoc deleted the fix/sandbox-log-timeline-ordering branch August 19, 2026 05:16
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.

1 participant