新增 V2 本地 Web UI:流式输出、Lab Trace、多主题 - #43
Merged
Merged
Conversation
New beautified web interface at /v2 with 9 themes, thread sidebar, lab trace drawer, and streaming output. Original UI at / is untouched. Includes SSE streaming for OpenAI-compatible providers and upgrade guide. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nalize The streaming bubble now shows real-time streaming response text (the answer typed out token by token) when the model is generating, and a compact step summary (thinking / tool use) when tools are running. Stop finalizing the bubble on run_end before the chat message arrives so it no longer disappears mid-response. Also derive workspace folder from chatJid as a fallback so fresh threads still hit the right trace events. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add full upgrade flow for users who cloned the original repo: add fork as a separate remote, merge, rebuild container, restart. Include both quick-revert (via tagged backup image) and full-revert (rebuild) paths. Clarify Docker vs npm responsibilities and why install location doesn't matter (mounts are derived from cwd at runtime). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove the Docker/npm relationship section and install-location section. Keep only: what changed, new features, new-user install, existing-user upgrade (with fork remote), and rollback paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The right drawer now flips to a full-height file preview when the user clicks a file link from a chat bubble or a "preview" button on a trace event (agent_tool_use, ipc_send). Images, code/text, and PDFs render inline; binary files fall back to download. A "← Lab Trace" button returns to the trace timeline. Add column resizers between thread rail / chat / trace. Drag to size (160px to 80% viewport), double-click to reset, persisted in localStorage. Default trace width bumped 420→560px so previews have breathing room. Add container/Dockerfile.viz: a multi-stage Dockerfile that copies Python + matplotlib/numpy/seaborn/pandas from python:3.11-slim-bookworm on top of the existing bioclaw-agent image, so agents can actually generate the images this preview drawer is now built for. Bypasses flaky Debian/Aliyun apt mirrors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…l-call JSON guard
Streaming bubble:
- Split into a "Process" strip (collapsed details, italic thinking, accent
tool name with mono command pill) and an "Answer" body styled like a real
bubble. Easy at a glance to tell what the agent is doing vs saying.
- Process strip is preserved (auto-collapsed) when the run finalizes so the
thinking history doesn't vanish.
Lab Trace drawer:
- Compact / Full segmented toggle. Compact (default) shows only step labels
(Thinking, Bash, Read, ...); Full adds the bodies (thinking text, command
args). Both modes always hide stream_output chunks.
Container fix (rebuild required):
- The OpenAI-compatible streaming SSE parser previously sent malformed
function.arguments to the model on the next turn when the stream truncated
mid-tool-call, getting rejected by DashScope/qwen with 400. Now we validate
the assembled args are parseable JSON; otherwise normalize to '{}' and, if
every tool call degraded, retry the same query non-streaming.
Dockerfile.viz now also rebuilds agent-runner so this fix lands in the image.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- humanizeStep rules cover 30+ bio tools, 35+ databases, 25+ file types - Auto-detect user language (LLM replies in user's language) - Visible Compact/Full trace mode toggle + clearer language switcher - Drop thinking-text extraction (often negative); rely on rule-based summaries - agent-runner: SSE tool_call JSON guard + 4-attempt exponential backoff for ECONNRESET - Dockerfile.viz: multi-stage copy of Python + SSL libs from python:3.11-slim-bookworm Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- / and /v2 now both serve the new V2 UI - /v1 serves the original UI (data unchanged) - Update UPGRADE-V2-UI.md to reflect new routes Co-Authored-By: Claude Opus 4.7 (1M context) <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.
概述
为
local-webchannel 新增一套 V2 UI,与原版完全并存:/默认指向 V2 UI/v1保留原版 UI(页面 / 数据完全不变)/v2作为别名指向 V2数据库、会话、群组配置、其他 channel(WhatsApp / 微信 / 飞书等)均不受影响。
主要功能
改动文件
src/channels/local-web/assets/v2/{index.html,app.js,style.css}UPGRADE-V2-UI.mdcontainer/Dockerfile.vizpython:3.11-slim-bookworm引入src/channels/local-web/channel.ts/和/v2→ V2,/v1→ 原版container/agent-runner/src/index.tssrc/index.tssrc/container-runner.tsContainerOutput.status加'streaming'类型不影响的部分
/换成/v1,页面、数据、行为完全不变.env不会被覆盖升级 / 回退
详细步骤见
UPGRADE-V2-UI.md,简要:回退:
git reset --hard <旧 commit>+ 重建容器,不影响数据存储。测试
/v1仍为原版页面,对话历史完整可见/、/v1、/v2均 200