Commit Graph
336 Commits
Author SHA1 Message Date
RockChinQ 13446ecfd3 fix: scope inflight snapshots and compact mobile dashboard (#2650) 2026-10-11 23:08:31 +08:00
RockChinQ 0b5b4cca59 fix(telegram): resolve real-client event and media delivery regressions 2026-10-11 10:14:11 +08:00
Hyu f0acbd7048 test: isolate Lark message converter mocks between cases 2026-10-11 01:18:16 +08:00
Hyu 33ea03701a test: update adapter and monitoring regression fixtures 2026-10-11 01:10:40 +08:00
Hyu 3ff849d243 test: align processor fixtures with current creation and startup behavior 2026-10-11 01:03:31 +08:00
Hyu 8fa5df6c77 feat(slack): support standard events and interactive callbacks 2026-10-11 00:17:27 +08:00
Hyu 7d4e13509b fix(slack): transfer message attachments through file APIs 2026-10-11 00:17:19 +08:00
Hyu 4a700ac0f3 feat(slack): add guided app setup and Socket Mode support 2026-10-10 23:37:30 +08:00
Hyu 5c8275e564 feat(weixin): show typing indicator during message processing 2026-10-10 22:50:51 +08:00
Hyu 405f1ac2e7 feat: refine Feishu streaming cards and add linked footer branding 2026-10-10 22:35:35 +08:00
Hyu 1c70218383 feat: reset bot session context while retaining monitoring history 2026-10-10 22:35:27 +08:00
Hyu b8a7649ac2 fix(monitoring): expire interrupted host executions using liveness leases 2026-10-10 21:30:04 +08:00
Hyu 38aa06e149 feat(monitoring): add shared SSE in-flight monitor with draggable dock 2026-10-10 21:30:03 +08:00
Hyu d2ec53ec91 feat(dingtalk): support group subscriptions and card interaction events 2026-10-10 21:29:49 +08:00
Hyu 4f43da0fb3 fix(wecombot): improve event routing and sandbox attachment delivery 2026-10-10 18:41:57 +08:00
Hyu a2b7f6b7bb fix: stabilize native streaming and improve bot controls 2026-10-10 18:02:42 +08:00
Hyu 4b370f0a92 fix(telemetry): skip unrouted events and preserve matched deliveries 2026-10-08 13:33:57 +08:00
RockChinQ f96f663a80 feat(assistant): add streaming background sessions and refresh workspace UI 2026-10-08 13:24:46 +08:00
Hyu 40a3a941a3 fix(monitoring): unify execution records and stabilize streaming cleanup 2026-10-08 03:02:37 +08:00
Hyu 9f76037e64 feat(monitoring): unify execution views and trace tool calls 2026-10-07 22:36:10 +08:00
Hyu 4482e8d876 feat(telemetry)!: upload one record per execution node and one closure per chain
Core no longer assembles a whole trace locally. Every workflow node is uploaded
the moment it completes as its own `execution_node` record, and each execution
closes with exactly one `execution_chain` record; all records of one execution
carry the same `event_id`, so Space groups them back into a single chain.

- every execution starts at an inbound event: event-less Pipeline lanes and
  WebUI/API debug runs synthesize their virtual inbound event at the boundary
  and are marked debug=true, so a Runner is never a trace origin
- sampling is decided once per event from a stable hash of the event id (the
  previous `int(id[:8], 16)` raised on every `platform:`-prefixed id and so
  dropped every successful inbound-event chain) and is reported on each record
  as sample{mode,denominator}; the default mode is now `all`
- the local trace buffer, the 120s TTL, the per-process trace cap and the shared
  open-node mirror are gone, which also removes the truncated-chain upload and
  the re-buffered-closed-trace leak they caused
- a broken chain is always uploaded, and its reason falls back to the first
  failed node so the chain explains itself
- flush keeps records until the sender accepts them and counts what it drops;
  telemetry health replaces the unused send-task queue
- heartbeat reports bound Agent / plugin-processor / event-binding counts
- bound Pipeline and Agent resources (plugins, MCP servers, knowledge bases,
  tools with their Host source, skills, models and the Runner schema selectors
  that picked them) are reported on the chain record
- failure text is bounded and redacted instead of passing exception text through
- the dead per-query feature counters and their call sites are removed

Wire contract: schema 2 (`execution_node` / `execution_chain`).
2026-10-07 09:41:41 +08:00
RockChinQ dcc7e17d77 fix(cloud): retain all execution records for activity counts 2026-10-03 05:03:02 +00:00
RockChinQ 17cda1612f fix(telemetry): avoid global plugin enumeration in workspace snapshots and support model adapters 2026-10-02 15:46:28 +00:00
RockChinQ 2e5bbc8bdd feat(web): integrate ecosystem social preview images 2026-10-02 02:16:38 +00:00
Hyu 34b5fe0202 fix(plugin): share the runtime file-transfer root and 404 uninstalled icon requests
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.
2026-10-02 01:34:47 +08:00
Hyu 38d5750785 fix(plugin): report when an installation failure happened, not when it was sampled
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.
2026-10-02 01:34:46 +08:00
Hyu 41820cd1a5 test(platform): follow the batched execution trace pipeline
The execution trace rewrite batches records and uploads them from
ExecutionCounters.flush(), replaced the per-trace direct send, dropped the
window counters, made the execution id the record identity and records the
inbound event stage after the routing stage. The ingress tests still asserted
the old mechanism, so they failed on every Python version.

Assert what the pipeline now emits instead: flush the buffered records and read
them back, require the trace registry to be empty afterwards, assert the
deterministic execution id, expect the route stage before the inbound stage,
and give the dispatch stubs the execution_id parameter the ingress passes.
2026-10-01 19:55:44 +08:00
Hyu 4c71de5eca feat(plugin): push plugin runtime ops samples to the Space control plane
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.
2026-10-01 19:01:16 +08:00
Hyu 923ebe12af feat(telemetry): attach called platform APIs to their step node on execution traces
Every host step now opens a stage scope, so observations recorded inside it (including cross-task plugin/RPC calls resolved through the execution registry) carry the owning step as parent; the pipeline lane records its own pipeline/run node so acks and replies issued outside the runner still hang off a node.
2026-10-01 18:10:42 +08:00
Hyu df64f83e12 fix(telemetry): schedule the trace payload send instead of dropping it
close_trace() called the coroutine TelemetryManager.start_send_task without
awaiting or scheduling it, so every payload closed on that path was silently
dropped and the runtime logged "coroutine ... was never awaited". The only
other caller awaits it correctly, so both call styles stay supported: call the
manager, schedule the returned coroutine on the running loop, and close it with
a debug log when no loop is available.

Regression case added in tests/unit_tests/telemetry/test_trace.py: it fails
before this change (payload never delivered) and passes after.
2026-10-01 02:32:28 +08:00
Hyu 0efc1fb1cc feat(telemetry): trace one inbound event end to end
Execution telemetry already reported window counters. This adds one bounded,
content-free chain per inbound platform event, so a single event can be
followed from its source platform through routing and processing to the
platform API calls it caused.

- telemetry/trace.py: ContextVar trace identity with route and run scopes, and
  a 32-stage bound per chain.
- telemetry/execution.py: keeps at most 64 chains for 120s, decides sampling
  from the observed outcome, and sends one payload per chain keyed by
  query_id = trace_id, so Space fetches a chain by primary identity. Window
  counters are unchanged and remain the source of coverage statistics.
- botmgr / pipelinemgr / orchestrator: bind the trace at the ingress boundary,
  scope routing identity per dispatch, and attach the run identity, so nested
  lanes (event -> route -> pipeline/runner -> platform API) reuse one chain. A
  run reached without an ingress (WebUI debug, service API) owns its own chain.
- space.execution_trace selects off | failures | sampled | all (default
  sampled: failures, WebUI debug runs and every N-th success).

Chains carry only code-defined identifiers (adapter and runner types, route
identity as type:uuid, run id); never message content, tool arguments or
platform user identifiers.
2026-10-01 02:12:44 +08:00
RockChinQ d3e4bd55cd fix: document telemetry opt-out and silence delivery failures (#2618)
* fix: document telemetry opt-out and silence delivery failures

* style: format telemetry debug logging
2026-09-30 22:27:05 +08:00
RockChinQ 30585c8657 refactor: remove beta diagnostics collection and reporting (#2616) 2026-09-30 20:24:35 +08:00
Hyu 5a31ac75fc style(tools): format the sandbox interpreter and skill tool changes with ruff 2026-09-30 18:45:00 +08:00
Hyu 4fc700b7e0 fix(tools): hide register_skill when Cloud sandboxes cannot scan host directories
scan_skill_directory is disabled for Cloud-managed sandboxes, but the
register_skill tool was still advertised to the model whenever a backend was
available, so every call failed closed without a usable explanation. Advertise
register_skill only when the runtime may scan sandbox directories, and keep
activate available in both modes.
2026-09-30 18:44:16 +08:00
Hyu ff3f321120 fix(tools): resolve the sandbox interpreter for workspace file scripts
The workspace file tools (read/write/edit/glob/grep) ran a script through
`python`, which a sandbox built from a host rootfs may not provide: those hosts
ship `python3` only, and a read-only /usr prevents creating a `python` shim
inside the jail. Every file tool then failed with `/bin/sh: 1: python: not
found`. Resolve the interpreter with `command -v python3 || command -v python`,
matching the interpreter the Box service already uses for its own scripts.
2026-09-30 18:44:16 +08:00
RockChinQ 1fde3b4283 fix(certification): align certified sharing and unsigned dedicated admission (#2610)
Integrate certification policy, SDK/Core semantics, and documentation on canonical branch. Resolve duplicated documentation and keep invalid Cloud signatures rejected.
2026-09-29 00:56:18 +08:00
RockChinQ 0468c2be15 Merge pull request #2609 from langbot-app/fix/cloud-unsigned-dedicated-20260928
fix(plugin): allow unsigned Cloud plugins as dedicated
2026-09-28 22:40:02 +08:00
Hyu 6ee9c0a9a3 fix(operation-trace): bind the workspace scope on every off-request write
Cloud runtime refuses unscoped database access and workspace_operation_logs is row-level-secured on the bound Workspace. The background writer, the retention pass and the metadata reads all run outside a request lifetime, so each of them failed and the failure was swallowed by the best-effort handler: enabling tracing recorded nothing at all.

The route wrapper also traces after the handler released its scope, so level resolution has to carry the Workspace itself. Without it the level read back as 0 and the request was dropped before it was even queued.

The startup gate now enumerates the Workspaces through this instance's execution bindings, because a cross-Workspace metadata scan cannot see them under RLS, and it runs after the Workspace service exists. The writer starts with a clean context so it cannot inherit the scope of the request that first enqueued a trace, and a dropped write is reported instead of being logged only at debug.
2026-09-28 22:38:35 +08:00
RockChinQ ce118b4f41 fix(plugin): allow unsigned Cloud plugins on dedicated workers 2026-09-28 14:26:10 +00:00
RockChinQ c384e4715a test(plugin): include stateless certificate model in shared fixtures 2026-09-28 09:14:54 +00:00
RockChinQ b51a448b1e feat: stateless certified shared worker
Implements stateless singleton component model for certified shared Workers, integrating with SDK 0.7.0.
2026-09-28 13:25:40 +08:00
TyperBody b0fab2386e Merge remote-tracking branch 'origin/master' into feat/workspace-operation-traceability 2026-09-28 01:56:03 +08:00
TyperBody 9ecb469d13 feat(operation-trace): lead with the change, fix pipeline extension tracing
The panel answered "who, when, what" poorly: the actual before → after diff
was hidden behind a click, the actor was a muted line, and a whole row went to
the route while duration and hash sat in a permanent right column. The data
already arrives with the page, so the panel now reads top-down in the order an
operator actually looks:

* who and when first, then the action and resource, then the diff spelled out
  inline (long values collapse to their size so a pipeline config does not
  render as two near-identical blobs), with route / method / status / duration
  / evidence hash moved into the expanded diagnostics line;
* the whole card is the expand toggle with a rotating chevron, which removes
  the ambiguity of a small text link whose expanded state looked identical;
* records are bucketed into today / yesterday / dated groups so a long history
  reads as a timeline;
* a "changes only" toggle (reusing the level filter) answers "who changed
  something" in one click -- in the live log 489 of 499 rows are pure views,
  so this is the difference between a haystack and the ten rows that matter.

Tracing fixes found while reading the live log:

* PUT /pipelines/<uuid>/extensions was classified as a plugin config change
  because the generic ('/extensions') rule ran first; it now maps to a
  pipeline-specific action;
* that handler recorded no diff at all, so "modified extension config" could
  never say what changed. It now captures the previous bindings and reports the
  before → after.

Cache: the integrity result is now keyed by (Workspace, listing filters) so
each view reuses its own verification, and a delete invalidates all views for
the Workspace. Fourteen tests cover the projection, the verifier, the cache
lifecycle and the failure modes.
2026-09-28 01:03:02 +08:00
TyperBody ed93e7f1ac perf(operation-trace): project hash columns and make the integrity cache safe
The integrity scan selected whole rows, so a cold pass paged in the
changes/detail payloads and the client fingerprint for up to
MAX_INTEGRITY_SCAN_ROWS rows the verifier never reads. Project only the hash
columns, and add a lightweight verifier so the scan no longer builds a full
display dict per row.

Repair the read cache so it is a latency shield, not a correctness shortcut:
a result computed within INTEGRITY_CACHE_TTL_SECONDS is served from the
per-Workspace cache (opening, refreshing and paging all land inside that
window and pay nothing), while a cache miss re-verifies the whole window. An
incremental scan that skips previously verified ids can never see an edit to
an already-cached row -- exactly the tampering this feature exists to expose.
Verified against a live 414-row log: 50 content edits and 7 re-signed links
are all detected, including an edit to a row verified on a previous pass.

Also fix two correctness gaps and one maintenance bug:
- age-based prune deleted rows without invalidating the cached prefix;
- the boundary baseline is now read only when the history exceeds the scan
  window, which a bounded scan makes the rare case;
- the operation-log retention block had drifted outside the per-binding loop
  in the maintenance task, so only the last discovered Workspace was ever
  pruned while the others grew unbounded.

Tests: scan projection, verifier parity, TTL cache reuse, cache-miss
re-verification, edit to an already-verified row, hash mismatch, chain break
and prune invalidation.
2026-09-27 23:43:51 +08:00
huanghuoguoguo 4f95016998 test(api): align CLI diagnostics with integration gates 2026-09-27 17:46:19 +08:00
huanghuoguoguo 07f3283abf feat(api): enable CLI diagnostics on current master 2026-09-27 17:31:06 +08:00
RockChinQ f488087cc4 Merge remote-tracking branch 'origin/master' into feat/certified-cross-tenant-worker-pool 2026-09-25 13:33:22 +00:00
RockChinQ 300f5825bb fix(plugin): fail closed on incomplete certification records 2026-09-25 13:13:35 +00:00
RockChinQ 9f296bd57e feat(plugin): route certified installs to shared workers 2026-09-25 12:48:55 +00:00