fix: sandbox 运行日志按时间排序并统一北京时间格式 - #42
Merged
Merged
Conversation
…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>
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.
问题
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.svelte的sandboxLog()用裸 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 通过