mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-14 03:30:19 +00:00
61586b9377
* 🐛 fix(agent): persist file attachments in hetero early-exit user message The hetero-agent early exit in execAgent created the user message without the `files` relation, so attachments sent from the SPA gateway path (executionTarget=device / sandbox) were never linked via messagesFiles and disappeared once the optimistic client message was replaced by the server snapshot. Attach the deduped `fileIds` the same way sendMessageInServer does on the local-mode path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * ✨ feat(agent): deliver image attachments to device/sandbox hetero runs Persisting the messagesFiles relation fixed display, but the dispatched CLI still never saw the image — local mode feeds the persisted imageList into sendPrompt for vision, while the device/sandbox dispatch protocols (agent_run_request / sandbox runner) only carried a text prompt. - resolve attached images into signed URLs in the hetero early exit (metadata-only, non-fatal) and carry them through heteroParams - add imageList to the agent_run_request wire type and dispatchAgentRun params (gateway client + server service) - extract buildHeteroExecStdinPayload into @lobechat/heterogeneous-agents so the three dispatch sites (desktop spawnLhHeteroExec, lh connect daemon, server sandbox runner) build the same content-block payload: systemContext, prompt, then image blocks - lh hetero exec already coerces image blocks via coerceJsonPrompt and normalizeImage (url → base64 for Claude Code, materialized path for Codex), so no CLI consumer changes are needed openclaw/hermes (runHeteroTask) keep text-only prompts — their dispatch goes through a separate one-shot tool protocol. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * ♻️ refactor(heterogeneous-agents): move exec stdin wire contract to a pure /protocol entry The server sandbox runner imported `buildHeteroExecStdinPayload` through the `/spawn` barrel, which (with no `sideEffects` hint) bundles the whole spawn machinery into the Next.js server chunk. Its `process.cwd()`-rooted dynamic fs calls then make Vercel's output file tracing glob the entire repo source tree into every serverless function (+~69 MB each), pushing the 4 largest functions past the 250 MB uncompressed limit and failing the deployment. Split the dispatch wire contract (stdin payload builder + content-block types) into a new pure, isomorphic `/protocol` export and point all three dispatch sites (server sandbox runner, desktop main, `lh connect` daemon) at it. `/spawn` re-exports the moved symbols so executor-side callers are unaffected. Also declare `sideEffects: false` for the package. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>