mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-14 03:30:19 +00:00
d00770a956
* ✨ feat: add AnalyzeVisualMedia inspector, Portal HTML preview refactor, and CE trace dedup - Add AnalyzeVisualMedia inspector and state types to builtin-tool-lobe-agent - Refactor Portal HTML renderer to use @lobehub/ui built-in HtmlPreview - Add portal artifact type selector and portal selectors to distinguish HTML/other artifacts - Dedup context_engine_result events in OperationTraceRecorder; add resolveCeEvent in viewer - Update .agents/skills/builtin-tool/references/ui.md with Tool Render design principles - Bump @lobehub/ui to 5.12.0 for HtmlPreview support Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * 🧪 test(trace-recorder): add deduplicateCeEvent tests for context_engine_result dedup Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * 🐛 fix(agent-tracing): wire resolveCeEvent into all CE reader paths All render functions and CLI inspect paths now call resolveCeEvent(step, allSteps) instead of reading step.events?.find(...) directly, so deduplicated steps correctly reconstruct their context_engine_result input/output by walking back through previous steps. Affected: renderSystemRole, renderEnvContext, renderPayloadTools, renderPayload, renderMemory, renderMessageDetail, renderStepDetail, and all --system-role / --env / --payload-tools / --payload / --memory CLI branches (both text and --json). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * ♻️ refactor(conversation): pass onRegenerate through ErrorMessageExtra and fix error guard order Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * ♻️ refactor(agent-tracing): lift context_engine_result out of events into typed contextEngine field Replace ad-hoc CE event dedup (mutating input/output inside events[]) with a dedicated `contextEngine` field on StepSnapshot that uses the same delta pattern as messagesBaseline/messagesDelta. CE data is structural state, not a streaming event — keeping it in events[] was a semantic mismatch. - Add `StepSnapshot.contextEngine?: { input?, output? }` with full delta semantics - OperationTraceRecorder: extract CE from events before building snapshotEvents, store in contextEngine, deduplicate via deduplicateCeSnapshot (no more mutations) - viewer: add resolveCeSnapshot (reads contextEngine first, falls back to legacy events format for old snapshots); deprecate resolveCeEvent alias - inspect CLI: update all call sites to resolveCeSnapshot - tests: rewrite deduplicateCeEvent suite → contextEngine dedup suite Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * 💄 style(loading): use colorTextTertiary for elapsed time display Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>