Commit Graph
79 Commits
Author SHA1 Message Date
huanghuoguoguo 1f227f7aa8 ci: scope PR checks and run the complete matrix daily (#3056)
* ci: streamline pull request checks and run the full matrix daily

Refs #3055

* ci: run runtime contracts only on affected Core checks

* test(ci): distinguish SDK checks from SDK publication

* fix(ci): retain legacy regressions and scope production image builds

* docs(ci): clarify focused regressions and production image selection
2026-11-17 17:31:50 +08:00
huanghuoguoguo 278667d690 feat(artifact): persist run output files behind authorized handles 2026-11-17 11:10:54 +08:00
huanghuoguoguo d83294ec08 test(artifact): cover released SDK and refresh contract fixtures 2026-11-16 21:39:23 +08:00
huanghuoguoguo 33dd118872 feat(artifact): add run-scoped on-demand attachment reads 2026-11-16 21:24:36 +08:00
huanghuoguoguo 7b1e231d2a build(core): install the bundled SDK for source deployments 2026-11-16 15:19:30 +08:00
huanghuoguoguo 53115d17d5 fix(ci): target external consumer environments explicitly 2026-11-13 17:06:16 +08:00
huanghuoguoguo 35d5e8c05d chore(plugins): sync Runner versions with Marketplace releases (#3013) 2026-11-12 20:23:44 +08:00
huanghuoguoguoandRockChinQ d9806dc5e1 feat(agent-runner): complete lifecycle contract and recovery (#2881)
* feat(agent-runner): close runner contract gaps

* fix(dify-agent): cap configurable stream budget

* feat(agent-runner): add retry resume and cancel ack

* feat(agent-runner): persist steering delivery state

* fix(agent-runner): requeue unacknowledged steering safely

* style(dify-agent): order stream budget imports

* style(agent-runner): format durable delivery changes

* style(dify-agent): format stream budget helpers

* fix(agent-runner): preserve direct ledger event writes

* fix(agent-runner): make steering durable and dispatch recovery attempts

* test(runner): use real event envelope in PostgreSQL lifecycle contract

* feat(runner): add resilient lifecycle protocol

* test(runner): cover steering ack and finalize metadata

* feat(runner): expose retry resume and cancel ack

* style(runtime): format plugin action handler

* fix(runner): preserve delivery compatibility and recovery boundaries

* style(runner): format rebased lifecycle tests

* fix(runner): route lifecycle actions through execution API

* fix(runner): preserve durable steering and recovery delivery

---------

Co-authored-by: RockChinQ <rockchinq@gmail.com>
2026-11-12 17:28:11 +08:00
9e31f971e5 fix(local-agent): fail runs on empty model answers and flag empty LLM calls (LANG-427) (#3001)
An LLM call that returns neither text nor tool calls was recorded as a
success and the run completed with an empty reply, so users got nothing
and no error (seen with gemini-3.8-flash on LangBot Models, whose gateway
swallowed an upstream schema error into an empty 200 stream).

LocalAgent 0.2.12: when the first answer of a run is empty, fall back to
the next configured model; with no fallback left, fail the run with
runner.empty_response (retryable) so the pipeline error handling replies.
An empty normal stop after tools ran stays a valid completion.

Core: a successful LLM call with no output or zero reported usage keeps
status success but records details.warnings and a visible message on the
monitoring LLM call, and logs a warning.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-12 15:47:19 +08:00
ea4c792337 feat(LeadCapture): 0–100 intent scoring, compliance risk and structured lead fields (#3000)
Driven by a customer's lead-scoring rubric (A/B/C keyword tiers, bonuses,
deductions, compliance-risk words, lead fields):

- the judge returns score/signals/risk/risk_reason/reason; levels come
  from configurable high_score (60) and ask_score (30), so medium and
  high intent are asked once; 0.1/0.2-style strong_intent answers still
  map to a score
- compliance risk (configurable risk_prompt) marks the lead "risk": no
  contact request, no sales email, listed for review
- once contact details arrive, configurable lead_fields are extracted
  from the whole conversation and shown at the top of the email (subject
  now carries level and score) and on the page
- Page: score/level column, risk total and filter, lead fields and
  per-judgment signals in the detail view
- bump to 0.3.0

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-12 15:15:15 +08:00
0184d37820 feat(LeadCapture): judgment timeline and "Lead judgments" Page (#2998)
Record every purchase-intent judgment per conversation (result, reason,
the user's message, an AI reply excerpt) plus the contact request,
captured contact, email attempts and errors as a per-user timeline
(latest 100 events). Users who were judged but not asked now get an
"idle" row; asking still happens at most once.

Add a read-only Page (留资判断记录 / Lead judgments): totals, a filterable
and searchable conversation list, and a detail panel with the timeline
and the 30 most recent messages. i18n en_US / zh_Hans. Bump to 0.2.0.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-12 14:58:18 +08:00
b038555b5a fix(local-agent): send one leading system message and alternating roles to models (LANG-426) (#2997)
Strict chat templates served by vLLM/SGLang (Qwen3.5/3.6, Mistral, Gemma)
reject a system message that is not first, and some APIs (DeepSeek reasoner)
reject successive user/assistant messages. LocalAgent sent the knowledge-base
context as a mid-conversation system message and the event-data message as a
second user turn, so any KB-backed run on Qwen3.5+ via vLLM/SGLang failed with
"Invalid request parameters".

- Retrieved KB context is untrusted data and now uses the user role.
- Every model call normalizes roles at the boundary: all system messages fold
  into one leading system message and consecutive user (or tool-call-free
  assistant) messages merge. Tool call/result turns are never merged.
- Bump LocalAgent to 0.2.11.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-12 14:56:55 +08:00
huanghuoguoguo cfa905a444 fix(n8n): fail runs on streaming workflow errors (#2994) 2026-11-12 10:13:09 +08:00
0d84c334ba feat(sdk): move the plugin SDK into the monorepo with independent releases (LANG-420) (#2993)
* chore(sdk): import langbot-plugin-sdk v0.7.24 snapshot into sdk/ (LANG-420)

Snapshot of langbot-app/langbot-plugin-sdk at 76443bb8 (tag v0.7.24),
without history. The repository's .github/ workflows are not imported;
they are replaced by sdk-*.yml workflows in the next commit. The root
.gitignore keeps the template .vscode/launch.json.example tracked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(sdk): move the plugin SDK into the monorepo with independent releases (LANG-420)

- CI: sdk-tests.yml / sdk-box-docker.yml run the SDK suite from sdk/ in
  its own environment (Python 3.10-3.12); run-tests.yml gains a
  "Core with in-tree SDK" job that overlays sdk/ on Core's venv.
- Releases: sdk-publish.yml publishes langbot-plugin from sdk/vX.Y.Z tag
  pushes and never creates a GitHub Release. Core release workflows now
  only accept v* tags, and scripts/check_sdk_release_pin.py blocks a Core
  PyPI/Docker release whose langbot-plugin pin differs from the released,
  unchanged sdk/.
- Packaging: Core still installs the PyPI pin. Core wheel/sdist, git
  export, Docker context, release ZIP and fnOS package exclude sdk/.
- Generator/tests: generate_plugin_workspace_api.py writes sdk/ directly;
  the SDK's generator drift tests now run instead of skipping.
- Docs: AGENTS/ARCHITECTURE, sdk/ guides (+ RELEASING.md, SOURCE.json),
  agent skills and lbs probes, public docs (zh/en/ja) and dev-docs
  point at sdk/ instead of the sibling langbot-plugin-sdk checkout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-11 23:12:53 +08:00
d3435a6a54 fix(dify-agent): keep form tokens and signed URLs out of httpx request logs (LANG-413) (#2988)
httpx logs every request as "HTTP Request: <METHOD> <full URL>" at INFO, and the
shared plugin runtime logs at INFO. Two Dify requests carry a credential in the URL:
the human-input form token (a path segment that submits the form on its own via
Dify's web API) and input file URLs that may be signed.

A filter on the httpx logger now rewrites the target of exactly those requests to a
redacted form while they are being opened; it is inert for everything else, so
co-located plugins' logs and the logger level are unchanged.

Also correct SHARED_RUNTIME.md/README: human-input continuations live only in the
active run and are not stored. Bump to 0.2.10.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-11 18:52:34 +08:00
a8929bf3ff fix(dify-agent): ask multi-field human input forms one field at a time (#2984)
* fix(dify-agent): ask multi-field human input forms one field at a time

A Dify human-input node with an input plus several actions (comment +
approve/reject) or several inputs becomes a multi-field interaction.
Every platform except DingTalk renders at most one field, and text-only
platforms never split a form, so the run failed with 'Interaction is not
supported'. When the whole form is unsupported, ask each field and then
the action as separate interactions and submit them to Dify together.

Release 0.2.9.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* chore(plugins): refresh catalog for DifyAgent 0.2.9

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-11 17:35:23 +08:00
69b7b45682 fix(agent): bound token counting and continue text turns on failure (#2969)
* fix(provider): decouple token counting from reasoning validation

Co-authored-by: multica-agent <github@multica.ai>

* fix(plugins): 修复 EssentialCommands !func 兼容性并清理 HelloPlugin 调试输出 (LANG-391) (#2967)

Co-authored-by: multica-agent <github@multica.ai>

* fix(plugin): wait for runtime recovery before workspace dispatch (#2968)

Co-authored-by: multica-agent <github@multica.ai>

* fix(runner): wait for installed plugins to initialize (LANG-393) (#2971)

Co-authored-by: multica-agent <github@multica.ai>

* fix(persistence): release SQLite writer during image refresh (#2973)

Co-authored-by: multica-agent <github@multica.ai>

* fix(telemetry): report cancellations as cancelled, keep route failure detail, tolerate already-terminal runs (#2974)

- Cancelled ingress / handed-off lanes / event deliveries close as `cancelled`
  instead of `failed` (CancelledError and GeneratorExit).
- Every `runner_failed` event-route record carries the exception type and
  message in `error`, including invalid Agent configuration.
- Closing the stream of a run another writer already finalized no longer
  raises "Cannot transition terminal run"; the ledger status is kept and
  reported, and the Runner's own error propagates.
- Platform API calls that return None without raising are `success`, not
  `unknown`.
- Command lanes name their adapter and no longer claim the Pipeline's
  configured Runner; only a Runner that actually ran is attributed.

LANG-395

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(agent): bound token counting and preserve text turns on failure

Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: multica-agent <github@multica.ai>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 12:31:59 +08:00
RockChinQandmultica-agent 3a56fa65a4 fix(runners): normalize reasoning config and handle completed/workflow outputs in Coze/Dify (LANG-398) (#2972)
Co-authored-by: multica-agent <github@multica.ai>
2026-11-11 12:31:31 +08:00
RockChinQandmultica-agent cce4011b88 fix(plugins): 修复 EssentialCommands !func 兼容性并清理 HelloPlugin 调试输出 (LANG-391) (#2967)
Co-authored-by: multica-agent <github@multica.ai>
2026-11-11 03:32:43 +08:00
0d3aa694cd docs(plugin): require persistence through storage APIs, not the filesystem (#2965)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-10 18:26:09 +08:00
6a709005a4 fix(acp): 修复文件回复的调用上下文与原始消息定位 (#2937)
* fix(acp): 修复文件回复的调用上下文与原始消息定位

* style(acp): 修正上下文回归测试的 Ruff 格式

* fix(acp): send ACP-shaped MCP descriptors and dispatch daemon MCP calls concurrently

- Serialize MCP servers for ACP through one shared helper so HTTP headers and
  stdio env are always [{name, value}] arrays (local and daemon paths alike);
  OpenCode rejects session/new with -32602 when headers is missing.
- Dispatch daemon mcp.request in its own task inside the owning job's
  Context so a slow tool call no longer blocks pings, run events or other
  jobs on the same daemon socket; cancel in-flight calls on disconnect after
  the daemon ID is released.
- Keep runtime internals out of the public Runner API docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Junyan Qin (Chin) <rockchinq@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-10 12:17:09 +08:00
d79f7f631b refactor(agent): one ordered media list for Runner inputs, attachments read by ref (#2959)
* refactor(agent): derive Runner input media from one ordered list

Every Runner input is now rendered once from the platform message chain
by agent/runner/input_media.py, replacing the contents/message-chain
cross matching, the descriptor merge from #2926 and the Box ref
reconciliation:

- contents place [attachment att-N: <type> <name>] at each media
  position; quoted messages are wrapped in [quoted message from X] ...
  [/quoted message] and their media marked source=quote.
- attachments describe the same media one-to-one as metadata only and
  never carry inline content. Media added by user_message_alter stay
  model-only.
- read_input_attachment(ref) serves bytes on demand (ExecutionAPI run
  scope, available_apis.input_attachments): base64, http(s) URL,
  adapter path, then adapter get_file_url for ID-only media; 10 MiB per
  attachment, 50 MiB per run, no caching or payload logging.
- Event envelopes carry inline payloads Host-internally until
  prepare_input_files registers them by ref; steering items drop refs
  that would address the claimed run's own input.
- The media cache defaults to a 1024 MB cap (oldest removed first).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* docs(plugin): document input attachment refs and read_input_attachment

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(plugins): read input attachments by ref in official Runners

Dify, Coze, Tbox and ACP read attachment bytes with
ctx.read_input_attachment when the SDK and Host support it, upload each
media once under an att-N prefixed name, and skip unreadable ones;
older SDKs or Hosts keep the previous inline/URL/contents logic.
DeerFlow takes images from contents only on current Hosts, n8n forwards
attachment metadata, and LocalAgent exposes refs to the model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* chore(deps): pin langbot-plugin 0.7.23 from PyPI

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* docs(plugin): note the SDK version for read_input_attachment

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(plugin): accept the SDK send_message timeout and route read_input_attachment

SDK 0.7.23 sends a client-side send_message timeout that the Runtime
strips; an older Runtime forwards it unchanged, so the Host now accepts
and ignores it instead of rejecting the call. The routing integration
test covers the new read_input_attachment operation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-09 20:40:13 +08:00
2577ea2155 feat(multica-agent): cap progress messages per run (0.2.1) (#2955)
QQ Official accepts 5 passive replies per user message, so an uncapped
"messages" progress run could use them all and lose the answer. Add
progress-max-messages (1-20, default 4) bounding progress lines, including
the closing line, in messages mode; stream mode is one message and is not
capped. Document that progress reaches non-streaming Pipeline platforms
only with langbot-app/LangBot#2954.

Refs LANG-325

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-09 18:57:58 +08:00
b526fd81c7 修复 ACPAgentRunner 会话时间显示与首帧等待反馈 (#2930)
* 修复 ACPAgentRunner 会话时间显示与首帧等待反馈

两处用户可见问题:

1. `!list` 直接把 ACP 返回的 UTC ISO 时间切片显示,导致时间比本地
   时区早 8 小时。新增 `_format_session_time()`,解析后按部署时区
   格式化,非 ISO 输入仍回退到原有截断逻辑。

   插件工作进程使用裁剪过的环境,通常不继承 `TZ`,此时
   `datetime.astimezone()` 会回退到 UTC。因此新增 `_display_timezone()`,
   优先读取 `TZ`,缺失时使用部署时区 `Asia/Shanghai`。

2. daemon 路径下,从收到消息到 agent 产出第一段文本之间没有任何
   RunnerResult,平台不会创建流式卡片,用户在这段等待期内看不到任何
   反馈(实测生成 PDF 时静默约 2 分钟)。在 `_run_daemon()` 入口先产
   出一个 `⏳` 占位 chunk,让平台立即建立流式卡片;后续 delta 的
   `all_content` 快照会覆盖该占位,最终回答不受影响。

插件版本提升至 0.1.20。

* fix(plugins): 同步 ACPAgentRunner 0.1.20 目录索引

* fix(acp-agent-runner): use host time zone and defer first-frame placeholder

- Drop the hardcoded Asia/Shanghai fallback: honour TZ, otherwise use the
  host local zone, and label the displayed time with its zone abbreviation.
- Emit the streaming placeholder only after the daemon is reachable so an
  offline daemon does not leave an orphaned placeholder card.
- Add tests for session time formatting and the placeholder behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Nikarhub <Nikarhub@users.noreply.github.com>
Co-authored-by: RockChinQ <rockchinq@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-09 16:36:35 +08:00
MartinandNikarhub 004af33276 修复 ACPAgentRunner 超长 stdout 帧导致的 daemon 自毁 (#2929)
ACP 使用行分隔的 JSON-RPC,单个帧可能携带较大的工具结果(文件内容、
diff、base64 媒体)。`asyncio.create_subprocess_exec` 未指定 `limit`,
StreamReader 沿用 64 KiB 默认值,`readline()` 遇到超长单行会抛
`LimitOverrunError`。

该异常会让 `_read_stdout` 任务直接崩溃,daemon 随即把读流失败判定为
“远程任务清理未确认”,主动退出并拒绝重连;hub 收到关闭码后永久 fence
该 daemon ID,之后所有请求都报 `daemon ... fenced`,只能重启插件运行时
才能恢复。

本次修改:

- 将 ACP 子进程 stdout 的行上限提升到 32 MiB;
- 即使超过该上限,也把 `LimitOverrunError` 转成单个请求的
  `AcpProtocolError`,不再让 reader 任务异常逃逸、拖垮整个 daemon。

复现验证:200 KB 单行在默认 64 KiB 下抛 `ValueError`,补丁后可正常读取。

Co-authored-by: Nikarhub <Nikarhub@users.noreply.github.com>
2026-11-09 16:08:15 +08:00
TyperBodyandmultica-agent 2029195630 fix(plugins/misc/HumanTakeover): truncate oversized sessions and live-refresh the console
Storage: MAX_SESSION_STORAGE_BYTES was only ever checked and raised; nothing
evicted by bytes. A 300-message cap cannot bound a session whose images are
stored inline as data: URLs, so two large images hit the 8 MiB ceiling and the
reply failed with "history has not been truncated". Evict the oldest messages
until the payload fits and keep the newest ones.

Console: the 5s poll only reloaded the session list and takeover status, never
the conversation, so replies from the other side never appeared without
switching sessions. Add a silent refresh that keeps the input enabled, preserves
scroll unless already at the bottom, and yields to scroll-up pagination.

Source was 0.1.7 while the shipped artifact is 0.2.7, so this also carries the
intermediate work; version 0.2.8.

Co-authored-by: multica-agent <github@multica.ai>
2026-11-08 11:55:12 +08:00
TyperBodyandmultica-agent d20f1ec609 refactor(plugins/misc/StickerHub): copy synchronously from the list cache
Review asked for copy to be synchronous instead of falling back to a `/item`
round trip: `/list` already returned the whole item and it is in `cache`, so
the URL is in hand. Removing the awaited hop matters beyond latency — the
`execCommand` tier needs the click's user-gesture window, and an await can
spend it before the write happens.

An empty URL still toasts instead of silently "succeeding", and the copy
handler no longer awaits anything. Verified in a real blob: iframe with the
real sandbox: the click issues no `/item` request at all, the clipboard ends up
byte-identical to the expected absolute URL, and it still does with
`navigator.clipboard` deleted.

Co-authored-by: multica-agent <github@multica.ai>
2026-11-07 15:15:53 +08:00
TyperBodyandmultica-agent a91210c43b fix(plugins/misc/StickerHub): copy the URL the page actually holds, inside the real sandbox
Copy was broken twice over. `langbot.api()` already resolves the unwrapped
payload (PageResponse.ok -> HTTP data -> resp.data.data -> the SDK's
resolve(data.data)), so `item.data.url` was always `undefined` and the page
copied an empty string. `writeText('')` resolves without throwing, so it also
never reached the fallback: the UI said "copied" while the clipboard stayed
empty.

The iframe is worse than assumed. It is a `blob:` document under
`sandbox="allow-scripts allow-forms"`, so its origin is opaque: `location.origin`
is "null", relative asset URLs do not load, and `navigator.clipboard` rejects
with NotAllowedError. `/list` returns relative URLs while `public_base_url` is
empty, so even a correct value would have pasted as an unusable path. URLs are
now made absolute against `location.ancestorOrigins[0]` before either the
clipboard or an `<img src>`, and copy reads `item.url` from the list cache
instead of making a redundant `/item` round trip.

Every other call had the same layer mistake: `res.error` is never set on a
resolved value, because failures reject the promise, so no failure ever
surfaced. All call sites now catch, and an empty URL toasts an error rather
than claiming success.

Verified in a real blob: iframe with the real sandbox: relative url -> absolute
-> clipboard read back byte for byte, and the same URL loads as the preview
(0 `/image` calls). Also passes with `navigator.clipboard` removed, proving the
execCommand tier is what carries it.

The host is untouched now, so this is plugin-only; the `allow-modals` flip is
dropped and the clear confirmation stays in-page.

Co-authored-by: multica-agent <github@multica.ai>
2026-11-07 15:09:17 +08:00
20383eccd4 feat(multica-agent): progress output and agent selection by name (0.2.0) (#2903)
* feat(multica-agent): progress output and agent selection by name (0.2.0)

- progress-mode (messages/stream/off) and progress-interval report the
  Multica task lifecycle (submitted, started, still running) while waiting;
  failures and timeouts send a closing line first. off keeps 0.1.x output.
- agent accepts a name or UUID, resolved once per conversation; ambiguous
  names list numbered candidates. agent-id stays as a deprecated UUID field.
- /multica agents|find <keyword> filter by name; /multica use <number>
  picks from the latest numbered list.
- capabilities.streaming: true; manifest 0.2.0.

Refs LANG-325

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(multica-agent): plugin-level language setting for chat output

- manifest spec.config.language (8 LangBot locales, default en_US, no auto).
- MulticaAgentPlugin.get_language() reads the invocation config; the runner
  falls back to get_plugin_config() when not hosted by the plugin class.
- pkg/i18n.get_text: unknown locale or missing key falls back to en_US, then
  to the key itself. Progress, commands, help, runner errors and config
  errors are localized; agent answers and Multica error text are not.
- /multica find without a keyword shows usage; help shows the language.

Version stays 0.2.0 (unreleased). Refs LANG-325

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-07 00:08:02 +08:00
45fbf367b1 fix(plugins): upload host-deduplicated inline images in Dify/Coze/Tbox runners (#2921)
* fix(plugins): skip host-deduplicated image refs in Dify/Coze/Tbox runners

Signed-off-by: ShryukGrandhi <85529990+ShryukGrandhi@users.noreply.github.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(plugins): give extensionless Dify uploads a MIME-derived extension

Signed-off-by: ShryukGrandhi <85529990+ShryukGrandhi@users.noreply.github.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Signed-off-by: ShryukGrandhi <85529990+ShryukGrandhi@users.noreply.github.com>
Co-authored-by: ShryukGrandhi <85529990+ShryukGrandhi@users.noreply.github.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-06 19:33:38 +08:00
c00110fd80 fix(dify-agent): make the SSE stream byte budget configurable (#2875)
* fix(dify-agent): make the SSE stream byte budget configurable

The Dify runner hardcoded a 16 MiB budget for the whole SSE stream and
described it as a 'runtime limit', so long agent runs whose tool
observations consume the budget failed with a misleading error and no
way to tune it.

- add a stream-budget-mb runner config (default 16 MiB, kept for
  compatibility) wired through AsyncDifyClient into limited_bytes /
  limited_lines
- report the actual received bytes and the configured limit when the
  budget is exceeded, distinct from the total deadline error

Addresses part 1 of #2851 (configurable budget and observable error).
The image attachment fallback (part 2) is intentionally not touched.

* fix(dify-agent): scale the event cap with the stream budget and name the last event

A single Dify SSE event larger than 1 MiB (one big tool observation or
node output) still failed with "Provider event exceeds the runtime limit",
and raising stream-budget-mb did not help. The per-event cap now stays at
the native 1 MiB for the default budget and grows to 1/16 of a raised one.

Budget errors now name the last SSE event and tool/node seen, carry the
dify.stream_limit_exceeded code and are logged as a warning, so long Agent
runs can be diagnosed from info-level logs (#2851).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: ShaoLOWu <310076244+ShaoLOWu@users.noreply.github.com>
Co-authored-by: RockChinQ <rockchinq@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-06 19:33:34 +08:00
670ec4f59b feat(plugins): add LeadCapture (purchase intent → contact → Resend email) (#2919)
New misc plugin langbot-team/LeadCapture 0.1.0 (购买意向留资):

- after each AI reply (NormalMessageResponded) a configured LLM judges
  strong purchase intent against a configurable prompt over the recent
  conversation (monitoring.messages, read-only)
- on strong intent, a fixed contact-request text is appended to that
  reply, once per bot+user
- user messages are then checked for contact details (patterns for CN
  mobile/landline, email, WeChat; LLM extraction as fallback)
- on capture, the full conversation is emailed via Resend (configurable
  API key, sender, recipients) with a .txt transcript attachment; failed
  sends are retried on later replies, up to 3 attempts; an optional
  thank-you is appended to the next reply
- every failure is logged and never breaks the conversation

Misc plugin CI now uses any plugin's own requirements-dev.txt.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-06 18:18:23 +08:00
4ddb350a9f feat(plugins): generalize OASlackBridge into HandoffBridge (any platform → any platform) (#2917)
* feat(plugins): generalize OASlackBridge into HandoffBridge

Rename langbot-team/OASlackBridge to langbot-team/HandoffBridge (人工客服
转接 / Human Handoff Bridge) 0.1.0 and make it platform-neutral:

- customer side: any bot (source_bot); staff side: any bot whose
  send_message returns message_id and whose inbound replies carry a Quote
  (Slack, Lark, QQ OneBot v11), posting to a group/channel or a private chat
- staff can reply to (quote) the request or any forwarded message; every
  forwarded message is mapped and all mappings are removed on close
- Slack escaping/decoding only when the staff bot is Slack (bot.read)
- the WeChat 48-hour rule becomes reply_window_hours (0 = no limit)
- components renamed to handoff (EventListener) and staff_reply (Runner)

READMEs rewritten for users, including how to find group IDs on each
platform and how to migrate from OASlackBridge. Misc plugin CI now uses
any plugin's own requirements-dev.txt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(HandoffBridge): platform-neutral handoff between any customer and staff bots

Content changes for the rename in the previous commit: generic config
(source_bot, staff_bot, staff_target_type/id, reply_window_hours),
per-message reply references, Slack formatting only for Slack staff bots,
user-facing READMEs, catalog/index/CI updates and tests for non-Slack and
private-chat staff targets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-06 18:00:23 +08:00
eab66af7e2 feat(api): let plugins and Agents read the Workspace language (LANG-334) (#2916)
- Document workspace.language.get with exposure 'all' and risk 'read' so
  plugins can declare it and Agents/Pipelines can select it as a workspace
  tool. It requires workspace.view, takes no arguments and reads the
  Workspace only from the trusted context. workspace.language.update stays
  member/API-key only.
- Declare the operation in LocalAgent.
- Document it in zh/en/ja plugin Workspace API references and dev-docs.
- Cover grants, denial, invalid input, the unset default and the processor
  tool path.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-06 17:42:33 +08:00
63ac89a5f1 feat(OASlackBridge): post user details in the takeover thread (#2914)
After the Slack root message, reply in its thread with the user's full
OpenID, session ID, Official Account bot, message count, first contact
time and the most recent user/AI messages (history_messages, default 10,
max 50). Data comes from the read-only monitoring.messages Workspace
operation, now declared; without the grant the details fall back to the
basic fields with a hint. Never blocks the takeover. Toggle with
send_user_details. Bump to 0.4.0.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-06 17:34:26 +08:00
RockChinQandmultica-agent e18195bc7c fix(plugins): name the installation binding instead of re-creating an invocation (#2915)
ai-source-v2 finding F-01 for RockChinQ/GitHubKit 0.2.3: the background poller
wrapped its whole lifetime in bind_invocation(handler, config, binding), so
after the scheduling command ended the loop still ran under a freshly created,
active invocation - tenant config, GitHub token and Host authority retained
outside the SDK's invocation lifetime.

Background Host calls (plugin KV read/write and message pushes) now pass the
immutable installation binding as their explicit action_context. call_action
validates it against the live connection (Workspace, installation, revision and
artifact), so the Host decides whether that installation may still act and
refuses a detached or superseded revision. The poller task starts in an empty
Context and keeps no invocation and no config snapshot; GC-visible token,
interval and language settings are re-read when the poller is (re)created.

Co-authored-by: multica-agent <github@multica.ai>
2026-11-06 17:19:20 +08:00
RockChinQandmultica-agent f66adde797 fix(plugins): deliver scheduled reminders with an explicit installation binding (#2912)
ai-source-v2 finding F1 for langbot-team/ScheNotify 0.2.7: the detached
scheduler wrapped its whole lifetime in bind_invocation, so a reminder fired
after the scheduling call ended still ran under a freshly created, active
invocation - authority re-established outside the SDK's invocation lifetime.

Each delivery now passes the immutable installation binding as the explicit
action_context of the Host action. call_action resolves and validates that
context against the connection binding (Workspace, installation, revision and
artifact), so the Host - not the plugin - decides whether this installation may
still act, a superseded revision or detached installation is refused, and the
loop needs neither an invocation nor a configuration snapshot. The manifest and
permissions are unchanged: delivery is still the bot.message.send capability.

Co-authored-by: multica-agent <github@multica.ai>
2026-11-06 16:53:59 +08:00
a814616204 feat(OASlackBridge): notify the Official Account user when takeover starts and ends (#2913)
* feat(OASlackBridge): notify the Official Account user when takeover starts and ends

Add start_notice / end_notice config (default Chinese texts, empty
disables). The start notice is sent after the Slack root message; the end
notice after !close or an observed expiration, before the AI reply. No
end notice past the 48-hour window or when the expired user's message
starts a new takeover. A failed notice never undoes the takeover change
and is reported in the Slack thread with the readable errcode.

Bump to 0.3.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* docs(OASlackBridge): rewrite README for end users

Step-by-step setup (Official Account auto mode, Slack app scopes/events,
finding the channel ID, permissions, processor subscription), staff usage,
troubleshooting and limits, in en and zh_Hans.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-06 16:35:29 +08:00
RockChinQandmultica-agent ba08a6d082 fix(plugins): refuse control characters before building a request target (#2910)
ai-source-v2 finding F1 for langbot-team/URLSummary 0.1.10: the URL extraction
pattern keeps control characters (a DEL survives the trailing punctuation
strip), so http.client raised InvalidURL quoting the whole relative request
target — query string included. The redaction boundaries only matched absolute
URLs, so a signed query reached the shared log verbatim.

Refuse control characters in validate_url before a request target exists,
skip such URLs during detection, and log only an exception class instead of
raw exception text (and frames only, not traceback.format_exc() tail).

Co-authored-by: multica-agent <github@multica.ai>
2026-11-06 15:34:14 +08:00
RockChinQandmultica-agent 12f7b315f5 fix(plugins): send the QWeather API key as a request header (#2907)
The API key travelled as a `key` query parameter. httpx logs
`HTTP Request: GET <full url>` at INFO level, so a successful request wrote
the installation's credential into the shared plugin runtime log (ai-source-v2
finding F-01 for langbot-team/QWeather 0.1.7). QWeather supports API KEY
authentication through the `X-QW-Api-Key` header, so pass the key there and
keep it out of the URL, and stop logging whole provider payloads at debug
level.

Co-authored-by: multica-agent <github@multica.ai>
2026-11-06 15:20:52 +08:00
RockChinQandmultica-agent 3ccccff1f7 fix(plugins): create shared asset gateway listeners tenant-free (#2901)
CozeAgent, DifyAgent and N8nAgent built their shared asset gateway listener
and per-connection service tasks inside the registering invocation, so the
listener's accept handle retained the first caller's invocation Context
(configuration plus revocable authority) and later connections inherited it.
Create the listener and connection tasks in an explicit empty Context; an
invocation Context is entered only per validated run token. Applies the same
fix already used by DashScopeAgent and LangflowAgent, with a regression test.

Co-authored-by: multica-agent <github@multica.ai>
2026-11-06 13:39:13 +08:00
f78a5176d5 chore(plugins): bump versions of plugins changed since their Marketplace release (LANG-323) (#2899)
Every listed version still carries the old langbot-plugins repository link,
and many also have unpublished source changes. Bump the patch version so
each can be republished from the LangBot repository. SDK requirements stay
as ranges.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-06 11:57:09 +08:00
1c8cc9a122 fix: keep models resolvable during Cloud reloads and report quota errors clearly (LANG-318) (#2896)
* fix(provider): keep models resolvable during reloads and report quota errors clearly

Cloud catalog syncs triggered by any directory change called
load_models_from_db(), which emptied every tenant's runtime model cache
before reloading Workspaces one by one. Messages arriving in that window
could not resolve their configured model, and LocalAgent failed with
"No authorized model for local-agent".

- Stage the reload in a separate manager and swap it in atomically;
  adopt unchanged providers instead of retiring and rebuilding them.
- Isolate per-Workspace load failures so one tenant cannot leave later
  Workspaces unloaded.
- Lazily load a persisted model on a cache miss (another replica,
  failed startup load, keys invalidated by a racing write).
- Classify New API quota errors (insufficient_user_quota,
  pre_consume_token_quota_failed, HTTP 402, quota wording) as
  quota_exceeded with a clear message in the Workspace language
  (English by default) instead of "Permission denied"/"API error".
- Read upstream codes from the response body and exception chain,
  and append safe machine codes to otherwise generic API errors.
- Report a missing API key explicitly instead of a raw OpenAIError.
- Keep HTTP status and body in the leased LiteLLM HTTP handler, which
  previously turned every HTTP error into "Connection failed".

Refs LANG-318

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(local-agent): accept bare model UUIDs and explain missing models

- parse_model_config accepts the bare model UUID shape the Host
  selector already accepts, instead of treating it as "no model".
- Replace "No authorized model for local-agent" with an actionable
  message pointing at the pipeline's model selection.
- Bump LocalAgent to 0.2.8.

Refs LANG-318

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-06 01:24:27 +08:00
afc426826d feat(plugins): add timezone config to ScheNotify for all tools (LANG-319) (#2894)
* feat(plugins): add timezone config to ScheNotify for all tools (LANG-319)

Add a `timezone` plugin config (IANA name, UTC, or an offset such as
UTC+8; empty keeps the server's local timezone). get_current_time_str
reports the time in it, schedule_notify interprets time_str in it, and
!sche / !dsche display reminder times in it. Reminders now store aware
instants, so the detached scheduler compares against UTC without reading
installation config. Bump to 0.2.7 and add tzdata.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(plugins): deliver ScheNotify reminders under audit-correlating SDKs (LANG-319)

The scheduler task was created with a copy of the scheduling invocation's
context, which carries the SDK's per-action audit correlation. SDKs that
close that correlation when the action returns (langbot-plugin 0.7.21,
pinned by Core) then rejected every delivery with "Plugin audit
invocation has ended", so no reminder was ever sent. Start the loop from
an empty context; it already re-enters the captured invocation.

Found during live acceptance; adds a regression test that relays the
audit correlation like the real handler.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-05 23:54:13 +08:00
ac0622ea3f feat(api): open marketplace search and install to plugins and Agents (#2891)
* feat(api): open marketplace search and install to plugins and Agents

- Add plugin.marketplace.search, a read operation that proxies the configured
  Space plugin search, honours plugin.enable_marketplace and returns only the
  fields needed to install.
- Expose plugin.install.marketplace to plugins and processors as a dangerous
  operation. Plugins and Agents cannot auto-confirm permissions or replace an
  installed plugin; new installations stay disabled until a member confirms.
  GitHub and local installs keep their current exposure.
- Expose task.get so callers can follow installation progress; non-member
  principals receive the public projection, now including
  pending_permission_confirmation.
- Declare the new operations in LocalAgent, document them in zh/en/ja and
  localize the new errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* test(api): include marketplace search and task status in processor read sweep

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-05 21:19:30 +08:00
4daa494cb8 feat(plugins): add MulticaAgent runner to chat with Multica agents (LANG-315) (#2889)
New Runner plugin plugins/Runner/multica-agent (plugin:langbot-team/MulticaAgent/default).
Each LangBot conversation maps to one Multica chat session; messages are posted
via the Multica chat API (PAT + X-Workspace-ID), and the runner polls until the
assistant reply for that task lands, then returns it.

In-chat commands (/multica agents|use|new) list agents and switch the agent per
conversation. Deleted sessions are recreated once; failed/cancelled/timed-out
agent tasks surface as run.failed with stable multica.* codes.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-05 20:10:23 +08:00
RockChinQandmultica-agent 045a7ccd8e LANG-313: register OASlackBridge Slack reply processor (#2887)
* feat(plugins): register OASlackBridge Slack reply processor

Co-authored-by: multica-agent <github@multica.ai>

* fix(plugins): keep pipeline open on bridge permission denial

Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: multica-agent <github@multica.ai>
2026-11-05 19:48:19 +08:00
be9385a86b docs(agents): document Unified API, standard adapter contracts and repo layout (#2885)
- AGENTS.md: add a repository layout section (docs/ vs dev-docs/, plugins/,
  skills/, tools/), Unified API rules for Workspace/Execution operations and
  consumer support, standard event/API alignment for adapters, and plugin
  development entry points; condense the backend language section.
- Add plugins/AGENTS.md, which AGENTS.md already referenced.
- Slim langbot-plugin-dev to a routing skill covering all component types,
  the Workspace/platform API catalogs and permissions; move pitfalls and
  testing notes to references and drop the host-specific deployment guide.
- Fix misplaced plugin-permission text in langbot-mcp-ops, add standard
  alignment rules to langbot-eba-adapter-dev, and update langbot-dev for the
  Application API and monorepo layout.
- Refresh skills/AGENTS.md and README for the monorepo; remove the unused
  vendored writing-skills copy from docs/.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-05 18:21:38 +08:00
huanghuoguoguoandClaude Opus 5.5 97ef5b457d feat(api): provide Workspace and execution API foundations (#2648)
Unified Workspace and execution APIs for LangBot (#2639).

- Versioned Application API shared by HTTP, MCP, the Workspace assistant
  and plugins, with one authorization and error contract.
- Execution API facade for every plugin and Runner action.
- Plugin installation permissions: manifest declarations, member
  confirmation, capability ceilings, compatibility mode, revocation and
  audit. Typed Workspace API in the plugin SDK.
- Processor tool configuration: workspace operations, event and bot tools,
  default tool sets for new Agents and Pipelines, and sensitive-tool
  warnings.
- Plugin permission picker in the WebUI; LocalAgent declares every
  plugin-callable permission.
- Documentation for plugin permissions and the Workspace API in English,
  Chinese and Japanese.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 16:36:22 +08:00
RockChinQandmultica-agent e2645a28c2 LANG-296: add Official Account–Slack support bridge (#2872)
* feat(plugins): add Official Account Slack bridge

Co-authored-by: multica-agent <github@multica.ai>

* fix(OASlackBridge): decode Slack replies before forwarding

Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: multica-agent <github@multica.ai>
2026-11-04 19:21:34 +08:00