Commit Graph

496 Commits

Author SHA1 Message Date
matevip
63f14acb72 fix(settings): stop bulk save from clobbering multimodal sidecar config 2026-05-10 19:15:27 +08:00
matevip
4e1afa6b6f feat(channel): parse wecom quoted-message context for inbound replies 2026-05-10 19:15:20 +08:00
matevip
2b84d94897 fix(channel): adaptive debounce window for paste-split long messages 2026-05-10 19:15:15 +08:00
matevip
3d1f0469ca feat(channel): wecom group reply slot + upload size limits + appmsg inbound
Group-chat reply slot fallback:
- The platform blocks proactive sends in group chats; outbound paths
  (cron summaries, async-task completions, generated image/music/3D
  delivery, TTS audio) silently failed because they fell through to
  the proactive-send command. New bounded LRU maps each group chat
  to its most recent inbound frame id; the dispatcher prefers that
  reply slot and falls through to proactive only for single chats.
- Centralised text and media dispatch through a single helper so the
  group rule never has to be re-implemented per outbound path.

Upload size pre-check + auto-downgrade:
- Without client-side limits, oversized uploads streamed for ~1 minute
  before the server rejected at the finish step — users saw nothing
  arrive in their chat. The new decision layer mirrors the platform's
  hard limits and produces three outcomes: rejected with a friendly
  reason, downgraded to a generic file delivery with an inline note,
  or pass-through unchanged.
- Files over 20MB reject. Images / videos over their 10MB limit
  downgrade to file. Voice content that isn't AMR or exceeds 2MB
  downgrades. AMR voice within 2MB stays native.

appmsg inbound parsing:
- Forwarded complex messages (document transfers, article links,
  miniprogram cards) used to fall into the inbound switch's default
  branch and silently drop. The new branch flattens four sub-types
  into a text marker the agent reads plus any media that needs to
  reach downstream tools — document forwards reuse the same magic-
  byte sniff and per-conversation upload layout as native file
  inbound, so extension recovery and chat-uploads serving work
  identically.
- Article links produce "[链接] title\ndescription\nurl" so the agent
  can summarize without round-tripping. Miniprograms surface their
  title. Unknown sub-types still emit a generic marker so the agent
  is never blind.
2026-05-10 15:13:14 +08:00
matevip
9075abfef2 feat(channel + settings): wecom quote message parsing + sidecar config preservation
WeCom quoted-message context:
- Parse the body.quote field that arrives alongside any inbound message
  (text / image / voice / file / mixed sub-types). When a user long-
  presses a previous bot bubble and types a follow-up like "解释一下",
  the agent now sees both the user's new text and the referenced
  content as proper context — replies stay on topic instead of
  guessing what was being explained.
- Quoted images / files are downloaded through the same pipeline as
  inbound new media (magic-byte sniff, ZIP container peek for
  DOCX / XLSX / PPTX recovery, chat-uploads layout) so the vision
  sidecar and document tools can actually analyse what was quoted.
- Reading order in the assembled prompt: "[引用消息: ...]\n<user text>"
  first, then quoted media parts, then the user's own current-message
  media. Mixed quotes flatten into a space-joined summary.

Multimodal sidecar settings preservation:
- The bulk settings PUT used to unconditionally overwrite the vision /
  video sidecar model ids — null in a partial payload became "" in
  the DB, silently wiping the configured sidecar every time a user
  saved an unrelated settings page (System / Music / Image / etc.).
  Symptom: "I picked a vision model, saved a different settings tab,
  now the bot can't see images anymore."
- Bulk save now guards both keys with non-null checks, matching the
  pattern used for music / 3D / image / video / tts / stt blocks.
- A dedicated /settings/sidecar endpoint always writes both keys, so
  the sidecar UI can still explicitly clear via null without leaking
  the write-on-null semantics into every other settings save.
- Frontend sidecar card switches to the dedicated endpoint; other
  settings pages keep their existing partial-payload behaviour.
2026-05-10 11:38:35 +08:00
matevip
2e0a4674e5 feat(channel): IM channel media + paste-merge + native file delivery
Inbound (WeCom):
- Save uploaded media under data/chat-uploads/{conversationId}/ with full
  fileName/path/fileUrl/storedName/fileSize on the content part. Web mirrors
  of an IM conversation now show real thumbnails instead of "未命名".
- Magic-byte sniff (PDF / PNG / JPEG / GIF / Office / ODF / archives /
  audio / video) recovers a real extension when the platform omits filename
  for forwarded files — no more PDFs labelled "file.bin".
- ZIP container peek distinguishes DOCX / XLSX / PPTX / VSDX / ODT / ODS /
  ODP / EPUB / JAR from a plain zip via discriminator paths and the OASIS
  mimetype entry.

Outbound (WeCom):
- Chunk upload field name corrected so server-side actually stores the
  bytes — file messages used to arrive with correct filename/size but
  empty content, breaking every PDF / DOCX / PPTX recipient.
- Scan agent text for served-file URLs in both the text-reply and
  content-parts paths; fetch bytes from the in-memory generated-file
  cache and dispatch through the native chunk upload + media message
  protocol so users receive a tappable file card instead of an
  unopenable markdown link. Cache miss surfaces a clear retry hint.

Async tool result forwarding:
- New AsyncTaskMediaDispatcher routes generation completions (image,
  video, music, 3D model) to whichever IM channel the conversation is
  bound to via ChannelSessionStore + ChannelManager. Web / webchat
  conversations are intentionally skipped — their SSE stream already
  renders the result.
- Wired into all four generation services so IM users actually receive
  generated media as native attachments. Each part now carries an
  absolute disk path so adapters read bytes locally instead of round-
  tripping through an authenticated served URL.

Slack native file upload:
- SlackChannelAdapter overrides the content-parts dispatch. Image /
  audio / video / file / model3d parts ride filesUploadV2 so users see a
  file card with preview thumbnail bound to the same thread as the
  originating message. Text parts continue through chat.postMessage.
- Resolves bytes from the part's local path, falls back to an HTTP fetch
  of fully-qualified URLs.

IM approval hint visibility:
- IM-driven approve / deny / auto-cancel / replay-error hints now go
  through saveMessage + tracker broadcast in addition to the channel
  adapter, so a Web mirror viewing the same conversationId sees the
  resolution. Previously hints reached only the IM channel; the Web
  admin console had no record of the outcome.

Adaptive paste-merge debounce:
- WeCom and other IM clients silently split long pasted prompts into
  fragments that arrive 0.5-2 seconds apart, missing the existing 500ms
  merge window. The agent then saw torn context and emitted multiple
  conflicting replies.
- When the merged buffer crosses a content-length threshold, extend the
  debounce window so subsequent fragments arrive in time. Default
  500ms unchanged for normal short messages.
2026-05-10 09:00:22 +08:00
matevip
ee48b114f6 chore: scrub external project references from wecom comments 2026-05-10 08:28:26 +08:00
matevip
f6b4f7e402 feat(channel): forward async tool results to IM channels + slack file upload 2026-05-10 08:28:20 +08:00
matevip
134fa1a975 fix(channel): wecom file pipeline + IM approval hint visibility 2026-05-10 08:28:14 +08:00
matevip
225d14026b feat(channel): wecom approval card + keepalive + chunk dedup 2026-05-10 08:28:07 +08:00
matevip
20393ea679 test(channel): wecom reply queue concurrency stress suite 2026-05-10 08:28:01 +08:00
matevip
78f6ca8d33 feat(channel): reply queue foundation + lifecycle gate 2026-05-10 08:27:48 +08:00
matevip
ae4d432ee2 fix(security): root-cause guards against blank tool guard rule rows 2026-05-10 08:27:42 +08:00
matevip
4567bd6019 fix(security): require tool guard rule id (#88) 2026-05-10 08:02:15 +08:00
matevip
f7c1af80a4 fix(wiki): preserve user-owned files when deleting directory-scanned raws (#84) 2026-05-09 17:15:57 +08:00
matevip
c2aecf18ef feat(agent,llm): multimodal sidecar routing for unsupported attachments (#87) 2026-05-09 16:41:26 +08:00
matevip
97e2b12f71 feat(chat): show reply model attribution in assistant message bubbles 2026-05-09 16:41:18 +08:00
matevip
d2886bdaa3 fix(llm): let custom OpenAI-compatible providers opt out of API Key requirement (#89) 2026-05-09 14:26:35 +08:00
matevip
88fb28a22a feat(stt): route OpenAI Whisper provider to any OpenAI-compatible endpoint (#76) 2026-05-09 13:57:52 +08:00
matevip
d5969bb32c fix(chat,llm): liveness-aware model popup with row-based configured check (#81) 2026-05-09 11:07:08 +08:00
matevip
95b7fed6d5 fix(docker): pin pnpm@10 + whitelist build scripts (#80) 2026-05-09 06:53:09 +08:00
matevip
52e06afec4 feat(llm,tool/image): dashscope-compat provider + media-gen test profile 2026-05-09 06:28:38 +08:00
matevip
3f289da6b7 feat(tool/image,video): image edit support + new DashScope models (#75) 2026-05-08 22:05:06 +08:00
matevip
1605146931 fix(workflow/draftgen): teach prompt Pebble logical operator syntax 2026-05-08 15:09:29 +08:00
matevip
2804905500 fix(workflow,trigger): template preview-compile + 3 alpha consistency cleanups 2026-05-08 15:09:14 +08:00
matevip
2416d603c4 fix(workflow,trigger): generator triggerDrafts loop closure + 5 paper cuts 2026-05-08 15:09:06 +08:00
matevip
826c20639a feat(workflow): natural-language → workflow draft generator + agent tool 2026-05-08 15:08:58 +08:00
matevip
dcf1f56944 fix(workflow,trigger): fan_out isolation + workspace spoof + approval→resume bridge + payload strict + draft clear 2026-05-08 15:08:41 +08:00
matevip
3ed540e6eb feat(workflow,trigger): async dispatch + GC schedulers + trigger list polish 2026-05-08 15:07:55 +08:00
matevip
ed64cda043 fix(workflow): PublishContext arg order + drop workspace-agnostic agent fallback 2026-05-08 15:07:32 +08:00
matevip
231724d6a9 feat(agent,trigger): wire agent_lifecycle as a real event source 2026-05-08 15:07:18 +08:00
matevip
dae74cf26c feat(channel,trigger): wire channel_message + content_match event sources 2026-05-08 15:07:11 +08:00
matevip
87727414d5 feat(workflow,trigger): wire workflow_completion as a real event source 2026-05-08 15:06:53 +08:00
matevip
e3af03645b feat(workflow): wire await_approval into the approval inbox 2026-05-08 15:06:46 +08:00
matevip
2a803d2904 fix(trigger): honest fireCount + last_error via DispatchResult 2026-05-08 15:06:28 +08:00
matevip
dac774f15e feat(workflow): trigger workspace isolation + step property editor + custom dialogs 2026-05-08 15:06:16 +08:00
matevip
844a64ad37 fix(workflow): hard-delete + blank-draft compile + canvas blank pane 2026-05-08 15:05:53 +08:00
matevip
20884c1773 feat(workflow): payload fs fallback for medium-size payloads 2026-05-08 15:05:28 +08:00
matevip
e09c62b529 feat(trigger): match pattern_json before fan-out + periodic sync 2026-05-08 15:05:20 +08:00
matevip
05a2caa47c fix(workflow): tighten workspace isolation across CRUD / run / resume 2026-05-08 15:05:13 +08:00
matevip
67c0efe8ae feat(workflow): add publish API + workflow / trigger REST controllers 2026-05-08 15:04:55 +08:00
matevip
ce08b311d3 feat(trigger): add event ingest pipeline with dedup / rate limit / bot-self 2026-05-08 15:04:48 +08:00
matevip
54b12f5270 feat(trigger): add cron trigger engine with lamport coordination 2026-05-08 15:04:41 +08:00
matevip
67279bb9c9 feat(workflow): add write_memory adapter with four merge strategies 2026-05-08 15:04:33 +08:00
matevip
7c3c68bcfe feat(workflow): add dispatch_channel adapter for multi-channel delivery 2026-05-08 15:04:26 +08:00
matevip
48559343e2 feat(workflow): add await_approval pause / resume to the runtime 2026-05-08 15:04:16 +08:00
matevip
4e457c2e8b feat(workflow): add linear runtime for the four base step modes 2026-05-08 15:04:07 +08:00
matevip
3065d095fd feat(workflow): add publish-time compiler for the linear step DSL 2026-05-08 15:03:53 +08:00
matevip
f3b1cba6dc fix(conversation): render image/video/audio attachment markers for LLM (#66) 2026-05-08 15:03:42 +08:00
matevip
d87ed0365a feat(workflow): add foundational schema for workflow runtime 2026-05-08 15:03:34 +08:00