Commit Graph
11 Commits
Author SHA1 Message Date
huanghuoguoguo 278667d690 feat(artifact): persist run output files behind authorized handles 2026-11-17 11:10:54 +08:00
huanghuoguoguo 33dd118872 feat(artifact): add run-scoped on-demand attachment reads 2026-11-16 21:24:36 +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
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
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
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
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
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 3a77306c3c feat(plugins): consolidate official plugins with independent releases (LANG-180) (#2797)
Co-authored-by: multica-agent <github@multica.ai>
2026-10-28 17:32:24 +08:00