🐛 fix(hetero): stop cross-message text duplication in server-ingest mode#15585
Merged
Conversation
In server-ingest mode (remote-device CC and cloud sandbox both run `lh hetero exec`), SerialServerIngester's `accumulatedText` spanned the whole run and never reset across assistant-message boundaries. Combined with `snapshotMode: 'replace'`, every later message's snapshot re-emitted all prior messages' text verbatim, which the server persisted into the new DB message — producing cross-message text duplication. Reset `accumulatedText` on `stream_start` / `stream_end` (emitted by the adapter's `openMainMessage`) after flushing the just-ended message's snapshot, so each message snapshots only its own text. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## canary #15585 +/- ##
===========================================
- Coverage 88.76% 70.42% -18.34%
===========================================
Files 905 3327 +2422
Lines 110729 333604 +222875
Branches 10961 30357 +19396
===========================================
+ Hits 98285 234935 +136650
- Misses 12261 98486 +86225
Partials 183 183
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This was referenced Jun 9, 2026
Closed
Closed
Closed
Merged
arvinxx
added a commit
that referenced
this pull request
Jun 10, 2026
# 🚀 LobeHub Release (20260610) **Release Date:** June 10, 2026 **Since v2.2.2:** 131 merged PRs · 13 contributors > This weekly release strengthens agent collaboration across cloud, desktop, CLI, and workspace flows, with steadier runtime behavior and a broader foundation for workspace-scoped data. --- ## ✨ Highlights - **Agent execution across devices** — Unifies per-device working directories, project skill discovery, and sub-agent suspend/resume behavior across server, QStash, and device RPC flows. (#15543, #15566, #15481, #15620, #15591) - **Connector and sandbox platform** — Expands connector permissions, custom OAuth MCP connector onboarding, sandbox provider support, and user-uploaded file sync into cloud sandbox runs. (#15463, #15546, #15184, #15550) - **Desktop and CLI reliability** — Fixes desktop cold-start, auto-update, Windows build, CLI skill discovery, and `lh connect` agent dispatch paths. (#15547, #15525, #15527, #15562, #15632, #15634) - **Pages and sharing** — Refreshes topic sharing, improves Page Editor layout behavior, and routes Page Agent tool execution through the server-side editor path. (#15581, #15556, #15588, #15023, #15610) - **Model availability and provider updates** — Adds user-scoped LobeHub model availability, Claude Fable 5, Qwen thinking preservation, and MiniMax M3 updates. (#15590, #15639, #13494, #15376) --- ## 🏗️ Core Product & Architecture ### Agent Runtime & Heterogeneous Agents - Improves sub-agent lifecycle handling, including async suspend/resume, queue-mode QStash resume delivery, and blocking nested sub-agent calls. (#15481, #15620, #15575) - Stabilizes heterogeneous agent ingestion and streaming with raw stream dumps, per-turn usage, image forwarding on regenerate, and duplicate-text fixes. (#15602, #15577, #15592, #15585) - Adds execution-device and working-directory controls across device RPC, legacy defaults, and remote-spawned Claude Code sessions. (#15543, #15566, #15591, #15572) - Improves runtime diagnostics and compatibility, including Gemini multimodal output capture, abort stream semantics, and trace quality analysis. (#15535, #13677, #15508) --- ## 📱 Platforms, Integrations & UX ### Connectors, Sandbox & Tools - Ships API-level connector tool permissions, custom OAuth MCP connector onboarding, and connector-first runtime execution. (#15463, #15546) - Adds sandbox provider support, cloud sandbox file sync, and safer external URL file input handling with SSRF validation. (#15184, #15550, #12657) - Improves tool visibility and execution with pinned app-fixed tools, ANSI output rendering, gateway-tunneled MCP calls, and automatic headless tool runs. (#15509, #15516, #15469, #15492) ### Desktop, CLI & Web UX - Restores desktop startup and reload behavior, preserves IPC error causes, and keeps the tab bar new-tab action visible across routes. (#15547, #15597, #15638) - Fixes desktop update and build stability for browser quit guards, macOS update signing, and Windows Visual Studio detection. (#15525, #15527, #15562) - Shows the plan-limit upgrade UI on desktop builds. (#15628) - Adds the Agent Run delivery checker and fixes CLI device dispatch plus skill list/search output. (#15489, #15634, #15632) - Refreshes onboarding, auth source preservation, topic UI states, referral/Fable campaign copy, and chat-input control bar behavior. (#15629, #15544, #15573, #15614, #15616, #15617, #15622, #15643) --- ## 🔒 Security, Reliability & Rollout Notes - External URL file input now includes SSRF validation for safer Google file handling. (#12657) - Database workspace-scope migrations are part of this release; self-hosted operators should run the normal migration path before serving the updated app. (#15446, #15465, #15468, #15472) - The release branch was re-cut from `canary` and includes the latest `main` release-version commit so `v2.2.2` is the verified compare base. --- ## 👥 Contributors @ONLY-yours, @sxjeru, @hardy-one, @xujingli, @hezhijie0327, @Coooolfan, @arvinxx, @tjx666, @Innei, @rivertwilight, @rdmclin2, @cy948, @AmAzing129 **Full Changelog**: v2.2.2...release/weekly-20260610-recut-3
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.
💻 Change Type
🔗 Related Issue
Part of LOBE-10157 (Bug 3 of 3). Bug 1 (no
agent_operations/ trace snapshot) and Bug 2 (empty tool result) are tracked separately in the same issue.🔀 Description of Change
Remote-device Claude Code and cloud-sandbox CC both run through
lh hetero exec(spawnLhHeteroExecfor devices,spawnHeteroSandboxon the server) and share the producer-sideSerialServerIngester.Bug:
SerialServerIngester.accumulatedTextis a per-message text accumulator that coalesces a message's text deltas into onesnapshotMode: 'replace'snapshot. But it was never reset across assistant-message boundaries, so it spanned the whole run. Each new message's snapshot therefore re-emitted all prior messages' text verbatim, and the server persisted that into the new DB message — producing the cross-message text duplication seen in topictpc_IkEBRHI18qdY(a later assistant message containing an earlier one's full text + its own).Fix: reset
accumulatedTextonstream_start/stream_endboundary events (emitted by the adapter'sopenMainMessage), after flushing the just-ended message's pending snapshot. Each message now snapshots only its own text. One fix covers both the device and sandbox paths.Verified against raw
claudestream-json: the upstream CC output is clean (each assistant message carries only its own text), confirming the duplication is introduced in lobehub's ingest pipeline, not by Claude Code.🧪 How to Test
Added a regression test in
hetero.test.ts: two assistant messages separated by astream_end/stream_startboundary must each snapshot only their own text (['first message', 'second message'], not['first message', 'first messagesecond message']). Confirmed the test fails without the fix and passes with it. Fullhetero.test.tssuite (20 tests) green.📝 Additional Information
Scope note: this is the highest-confidence, reproducible part of LOBE-10157. The remaining two bugs need separate work — Bug 1 is a server-side operation/trace gap in the heterogeneous ingest path; Bug 2 (empty tool result) was shown not to be an adapter extraction bug and needs the actual failing run's raw stream to root-cause.