* 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>
* fix(plugin): stop member-driven install paths from stalling on permission confirmation
- Runner/event-processor installs from the Agent and Pipeline forms and
knowledge-engine installs from the knowledge base form now auto-confirm
declared permissions, so their registration polling no longer times out.
- RAG migration confirms the plugins it installs on behalf of the member
running it and reports plugin_permission_confirmation_required otherwise.
- Upgrading a confirmed compatibility-mode installation to another
compatibility-mode package keeps it enabled with the full legacy grant set.
- The WebUI install task reads pending_permission_confirmation, the key the
backend actually writes; the marketplace task clears it after auto-confirm.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
* test(web): expect auto-confirm on inline marketplace installs
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>
Plugin and Box now share one transport rule via
ManagedRuntimeConnector.select_runtime_transport(): an explicit endpoint,
Docker or --standalone-* means WebSocket to an external runtime; every
other case (Windows, Linux, macOS) launches the runtime as a child
process and talks over its stdio pipes.
The Windows-only "subprocess + WebSocket" branch is removed from both
connectors together with its helpers (control-token generation, port
probing, readiness polling, subprocess disposal). Since langbot-plugin
0.6.0 the runtime side reads/writes stdio from blocking threads on
Windows, so the WinError 6 that motivated the branch no longer applies.
Docs (zh/en/ja compatibility + deep-dive, ARCHITECTURE.md, dev-docs
reviews) now describe the actual transports, including the Windows
runtime-to-worker WebSocket on the plugin debug port.
Refs #2545
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
The pipeline debug chat runs on a per-Workspace in-memory RuntimeBot with the
reserved uuid websocket-proxy-bot. It never has a bots row, yet three plugin
guards looked data["bot_uuid"] up in that table, so SEND_MESSAGE (and
call_platform_api send_message), GET_BOT_INFO and authorize_action all
rejected it with "Bot ... not found" / "Bot is not available in this
Workspace". GET_BOT_INFO additionally called bot_service.get_runtime_bot_info,
which queries the table again.
- utils/constants: WEBSOCKET_PROXY_BOT_UUID; replace the 9 hardcoded literals.
- PlatformManager.has_websocket_proxy_bot(workspace_uuid): presence check
that never creates a proxy.
- authorize_action and the handler's new _bot_available() accept the proxy
uuid only while this Workspace has a live proxy; persisted bots still go
through the bots table, and capability checks are unchanged.
- GET_BOT_INFO builds the proxy's info from the live runtime (no adapter
config, no webhook). bot_service / the bot.runtime.get operation are
untouched, so HTTP/MCP/Workspace API behavior does not change.
Closes#2935
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
On cloud.langbot.app the final run failed before touching any Workspace:
fetching Marketplace versions hit BlockingWorkCapacityError while about
1400 bots reconnected, and the once-per-process sweep gave up. Retry the
idempotent run after 60, 120, 300 and 600 seconds.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
The first fleet-wide Cloud run hit DNS errors and blocking-executor
saturation while 1400 bots reconnected, and an upgrade whose confirmation
failed was left disabled and was not confirmed by a later run. Retry
upgrade and confirmation, and confirm every listed installation that is
pending confirmation. Tenant-disabled installations keep their confirmed
snapshot and stay off. Document that env overrides persist in
data/config.yaml.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
Cloud tenants can only upgrade plugins one Workspace at a time in the
WebUI. plugin.marketplace_upgrade.plugins lets an operator upgrade listed
Marketplace plugins across all active Workspaces from inside Core, through
the same tenant fence and upgrade_plugin path as the WebUI. Installations
that were enabled have their declared permissions confirmed as an owner
operator, so plugins without a permission declaration are not left
disabled. Tenant-disabled installations stay disabled. An optional
Workspace allowlist supports a canary run.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
* feat(monitoring): show messages handled by plugins in monitoring
A plugin can take a message over with prevent_default() and answer through
ctx.reply / send_message / invoke_llm. Monitoring then showed the user
message as handled by the pipeline Runner, with no reply, no LLM call and
no delivery errors (LANG-320).
- monitoring_messages.handled_by (0045): runner:<id> | plugin:<author>/<name>;
plugin-handled messages no longer claim the Runner.
- Attribute prevent_default to the plugin reported by the Runtime, falling
back to a single emitted plugin for older Runtimes.
- Record ctx.reply and plugin send_message as assistant messages, with
PluginReplyError / PluginSendError on failure; delivery behaviour is
unchanged and monitoring failures are swallowed.
- Link plugin-level LLM calls and sends to the triggering message through
origin_query_uuid. The Host opts in per event (origin_attribution), so
plugins never send the new field to Hosts with strict schemas. Used for
attribution only, never for authorization.
- WebUI: "Handled by plugin" badge in the execution list and detail.
- Docs (zh/en/ja) and dev-docs contract note.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
* test(migrations): account for the 0045 handled_by index on downgrade
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
* test(postgres): register the capacity requester instead of patching _build_provider
#2896 builds providers on a staged ModelManager during load_models_from_db,
so the per-instance _build_provider patch no longer applied and the populated
Cloud startup test loaded zero providers on master. Register a network-free
requester that the staged manager inherits instead.
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>
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>
Stdio and Windows launches always bound the SDK default debug port 5401,
so changing plugin.display_plugin_debug_url only updated the console URL
and a second Core instance hit Address already in use. Pass the configured
debug (and Windows control) ports into the Runtime CLI, and document the
behavior.
Fixes#2713
Co-authored-by: Li-john1021 <li-john1021@users.noreply.github.com>
The host inspects a package to read manifest.yaml and requirements.txt before the
SDK extracts it. Inspection normalized entry names with only
replace('\\','/').strip('/'), so it accepted names its own extractor rejects
(absolute paths, '..' components, drive letters) and it silently kept the first
member when two normalized to the same path.
There was no traversal write, because the SDK's _extract_verified_zip validates
every member before writing and the host only reads members by ZipInfo. The bug
is the divergence: a package could pass inspection and then fail to install, and
the two rule sets could drift further as either side changes.
Inspection now applies the same rule set as the SDK, via
_normalize_archive_entry_name: reject empty/NUL names, absolute paths, any '..'
component and drive letters; reject a duplicate after normalization. '.' and
empty segments are still collapsed, so './manifest.yaml' and 'components//x.py'
keep working.
Tests: 13 cases covering each rejection, the duplicate, traversal taking
precedence over the duplicate check, and two positive cases (nested/unicode
layout, cosmetic separators).
Co-authored-by: multica-agent <github@multica.ai>
The SDK binds one transfer root inode (mode 0700) and picks it per profile: a shared worker uses /tmp/lbp-rpc while a host without the profile env fell back to data/temp/lbp, so plugin icons and assets died with 'Invalid file transfer capability'. The host now pins the shared root, and a plugin absent from the resolved Workspace answers 404 instead of 500.
The connector stored only uuid/code/message, so the ops reporter stamped every entry with its own sampling time and a stale failure looked freshly broken on each report. Failures now carry failed_at and the payload publishes it.
The shared Cloud deployment runs one Plugin Runtime for every Workspace, but
nothing reported its health: the instance only exposed two aggregate numbers on
its own health probe, and the per-installation failure registry, the desired
state registry and the reconcile outcome lived in memory with no reader.
Add RuntimeOpsReporter, which every 30 seconds reads the Runtime ``/healthz``
probe over HTTP (derived from ``plugin.runtime_ws_url``), merges it with the
connector's desired-state, failure and reconcile summaries, and posts one
sample to the Space control plane on the existing authenticated direction.
Delivery is best-effort and bounded: a single in-flight request, a ten second
timeout, dropped samples counted in ``runtime_ops`` on the instance health
probe, and a failed probe recorded as a drop so the dashboard shows staleness
instead of grading a stale sample as healthy.
Cloud-only: a non-cloud deployment never enables the reporter, and the channel
is independent of product telemetry so ``space.disable_telemetry`` cannot blind
the ops dashboard.
The certified-archive admission gate treated any declared certificate it could
not resolve as an untrusted archive and rejected the install with
CERTIFIED_PLUGIN_OSS_FORCE_REQUIRED. OSS ships an empty
plugin.certification.trusted_public_keys ring and the marketplace signs every
package with its own issuer key, so all certified marketplace packages (for
example langbot-team/RunnerDemo and langbot-team/LocalAgent) failed at the
'validating plugin package' step before artifact storage.
Admission now distinguishes an unresolvable declaration from a configured trust
decision that fails:
- record certificate_id only when the key_id is actually present in the
configured ring, so an empty ring yields an unresolvable declaration;
- OSS degrades an unresolvable declaration to the existing oss_dev dedicated
profile with CERTIFIED_PLUGIN_OSS_UNTRUSTED_DEDICATED instead of blocking;
- a resolvable declaration that still fails keeps requiring the explicit
administrator force (CERTIFIED_PLUGIN_OSS_FORCE_REQUIRED);
- Cloud stays fail-closed and rejects before storage.
No shared-runtime privilege is granted when the issuer is not trusted, so this
withholds isolation rather than escalating it.